Re: [GENERAL] PostgreSQL to Oracle

2009-02-27 Thread Artacus
Hi All, I want to migrate from PostgreSQL to Oracle and need any tool preferably open source. And I am specially concerned with stored procedures / functions. Regards, Abdul Rehman. You were just converting from Oracle to Postgres two days ago, so it shouldn't take much to convert back.

Re: [GENERAL] Question about no unchanging update rule + ALTER

2009-02-27 Thread Richard Huxton
Josh Trutwin wrote: I found the following on a blog post (http://www.depesz.com/index.php/2007/09/08/avoiding-empty-updates/) which had a rule to prevent empty updates: CREATE RULE no_unchanging_updates AS ON UPDATE TO test_table WHERE ROW(OLD.*) IS NOT DISTINCT FROM ROW(NEW.*) DO

Re: [GENERAL] funny view/temp table problem with query

2009-02-27 Thread Grzegorz Jaśkiewicz
2009/2/27 Scott Marlowe scott.marl...@gmail.com: On Thu, Feb 26, 2009 at 3:02 AM, Grzegorz Jaśkiewicz gryz...@gmail.com wrote: First of all, I wonder why the same query divided up in half - and using temporary table works as expected, and with everything together I'm betting it's your use

Re: [GENERAL] funny view/temp table problem with query

2009-02-27 Thread Scott Marlowe
On Fri, Feb 27, 2009 at 3:10 AM, Grzegorz Jaśkiewicz gryz...@gmail.com wrote: 2009/2/27 Scott Marlowe scott.marl...@gmail.com: On Thu, Feb 26, 2009 at 3:02 AM, Grzegorz Jaśkiewicz gryz...@gmail.com wrote: First of all, I wonder why the same query divided up in half - and using temporary

Re: [GENERAL] funny view/temp table problem with query

2009-02-27 Thread Grzegorz Jaśkiewicz
2009/2/27 Scott Marlowe scott.marl...@gmail.com: Nope. as far as I can understand it, if I do the same thing in two steps, and in one step. And the latter is broken, because of some internal process/optimization/whatever - that's a bug to me. Unless I am expecting it to work, and it was just

Re: [GENERAL] funny view/temp table problem with query

2009-02-27 Thread Scott Marlowe
On Fri, Feb 27, 2009 at 3:16 AM, Grzegorz Jaśkiewicz gryz...@gmail.com wrote: 2009/2/27 Scott Marlowe scott.marl...@gmail.com: Nope. as far as I can understand it, if I do the same thing in two steps, and in one step. And the latter is broken, because of some internal

[GENERAL] function to return rows as columns?

2009-02-27 Thread Linos
Hello, i have a query that returns a result set like this: item | size | stock 123 | XL | 10 123 | XXL | 5 123 | XS | 3 and i would like get the results like this: item | XL | XXL | XS 123 | 10 | 5 | 3 i have been thinking how to do it with a plpgsql function but the

Re: [GENERAL] function to return rows as columns?

2009-02-27 Thread Thomas Kellerer
Linos, 27.02.2009 11:41: Hello, i have a query that returns a result set like this: item | size | stock 123 | XL | 10 123 | XXL | 5 123 | XS | 3 and i would like get the results like this: item | XL | XXL | XS 123 | 10 | 5 | 3 i have been thinking how to do it with a plpgsql

Re: [GENERAL] function to return rows as columns?

2009-02-27 Thread Linos
Thomas Kellerer escribió: Linos, 27.02.2009 11:41: Hello, i have a query that returns a result set like this: item | size | stock 123 | XL | 10 123 | XXL | 5 123 | XS | 3 and i would like get the results like this: item | XL | XXL | XS 123 | 10 | 5 | 3 i have been thinking

Re: [GENERAL] function to return rows as columns?

2009-02-27 Thread A. Kretschmer
In response to Linos : Hello, i have a query that returns a result set like this: item | size | stock 123 | XL | 10 123 | XXL | 5 123 | XS | 3 and i would like get the results like this: item | XL | XXL | XS 123 | 10 | 5 | 3 Other solution with plain SQL:

Re: [GENERAL] function to return rows as columns?

2009-02-27 Thread Linos
A. Kretschmer escribió: In response to Linos : Hello, i have a query that returns a result set like this: item | size | stock 123 | XL | 10 123 | XXL | 5 123 | XS | 3 and i would like get the results like this: item | XL | XXL | XS 123 | 10 | 5 | 3 Other solution with

Re: [GENERAL] funny view/temp table problem with query

2009-02-27 Thread Gregory Stark
Alban Hertroys dal...@solfertje.student.utwente.nl writes: On Feb 26, 2009, at 11:02 AM, Grzegorz Jaśkiewicz wrote: looks like you completely misunderstood my question. I'm not surprised. What do you expect with random capitalisation, random table alias names and random indentation

[GENERAL] Standalone ODBC Driver

2009-02-27 Thread Tim Tassonis
Hi all I remember, a while ago somebody mentioning an odbc driver for postgres that is not dependant on a working postgres client installation. Unfortunately I lost the link to it, can anybody remember? ( I tested it then and it worked fine for simple task, but then switched back to the

Re: [GENERAL] funny view/temp table problem with query

2009-02-27 Thread Grzegorz Jaśkiewicz
On Fri, Feb 27, 2009 at 11:57 AM, Gregory Stark st...@enterprisedb.com wrote: Uh, we get a lot of really mangled SQL and explain plans -- I don't see anything wrong with these. If the question was unclear it sounds like it's just because it's a fairly subtle problem and was hard to describe.

[GENERAL] strange performance problem

2009-02-27 Thread Linos
Hello i have the same table with the same data in my development machine and in a small server in production. The table is this: Tabla «modelo_subfamilia» Columna| Tipo | Modificadores ---+---+--- nombre| character

Re: [GENERAL] strange performance problem

2009-02-27 Thread Richard Huxton
Linos wrote: 2009-02-27 13:51:15 CET 127.0.0.1LOG: duración: 4231.045 ms sentencia: SELECT nombre, subfamilia_id, id_familia, hasta, foto, id_seccion, id_categoria FROM modelo_subfamilia PSQL with \timing: -development: Time: 72,441 ms -server: Time: 78,762 ms but if i load it from QT

Re: [GENERAL] strange performance problem

2009-02-27 Thread Linos
Richard Huxton escribió: Linos wrote: 2009-02-27 13:51:15 CET 127.0.0.1LOG: duración: 4231.045 ms sentencia: SELECT nombre, subfamilia_id, id_familia, hasta, foto, id_seccion, id_categoria FROM modelo_subfamilia PSQL with \timing: -development: Time: 72,441 ms -server: Time: 78,762 ms

Re: [GENERAL] PostgreSQL to Oracle

2009-02-27 Thread Martin Gainty
1)Strip all Postgres and or user-specific custom datatypes for ex if you see an in or out var declared as fubar chances are this wont map correctly in Oracle 2)Get to know packages..they work well to aggregate and organise 2a)Functions and Procedures which are used for a specific purpose for

Re: [GENERAL] Standalone ODBC Driver

2009-02-27 Thread Joshua D. Drake
On Fri, 2009-02-27 at 13:30 +0100, Tim Tassonis wrote: Hi all I remember, a while ago somebody mentioning an odbc driver for postgres that is not dependant on a working postgres client installation. Unfortunately I lost the link to it, can anybody remember? ODBCng?

[GENERAL] when to use execute in plpgsql?

2009-02-27 Thread Enrico Sirola
Hello, I'm having some troubles with the correct use of the execute plpgsql statement. Where I work, we have a postgresql db hosting a set of schemas all with the same tables and, from time to time, we upgrade the schemas to a new version coding a stored procedure like the following

[GENERAL] db_restore and xml data

2009-02-27 Thread Enrico Sirola
Hello, I have a pgsql database hosting xml data in xml columns. The data, have !DOCTYPE declarations at the beginning, so it is saved with XMLPARSE (DOCUMENT text) when I try to restore a database from dump, pg_restore complains because the data it tries to restore is not an xml content

Re: [GENERAL] foxpro, odbc, data types and unnecessary convertions

2009-02-27 Thread Fernando Moreno
Thank you very much for your advice, I guess I'm wasting my time in this 'problem'. I'm going to check that class, it seems pretty useful. And by the way...yes, this is a born-dead app (at least on the client side) and it's likely to be ported to .NET in the future, but like I said before, it's

Re: [GENERAL] when to use execute in plpgsql?

2009-02-27 Thread Fernando Moreno
Hi, check this out: http://archives.postgresql.org/pgsql-general/2008-05/msg00938.php I would say that execute is the only way to achieve some things related to schemas and temp tables. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] Hiding row counts in psql

2009-02-27 Thread Ben Chobot
Is there a way in psql to hide the row counts but keep the column headers? The man page talks about \t and --tuples-only, but both of those also suppress column headers. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Standalone ODBC Driver

2009-02-27 Thread Tim Tassonis
Joshua D. Drake wrote: On Fri, 2009-02-27 at 13:30 +0100, Tim Tassonis wrote: Hi all I remember, a while ago somebody mentioning an odbc driver for postgres that is not dependant on a working postgres client installation. Unfortunately I lost the link to it, can anybody remember? ODBCng?

Re: [GENERAL] Standalone ODBC Driver

2009-02-27 Thread Joshua D. Drake
On Fri, 2009-02-27 at 19:06 +0100, Tim Tassonis wrote: Joshua D. Drake wrote: On Fri, 2009-02-27 at 13:30 +0100, Tim Tassonis wrote: Hi all I remember, a while ago somebody mentioning an odbc driver for postgres that is not dependant on a working postgres client installation.

Re: [GENERAL] Postgresql selecting strange index for simple query

2009-02-27 Thread Tom Lane
Maxim Boguk mbo...@masterhost.ru writes: Tom Lane wrote: Could you send me a dump of this test_table off-list? It seems like there must be something strange about the stats of last_change_time, but I don't feel like guessing about what it is ... Here attached is small part of table (1160

Re: [GENERAL] when to use execute in plpgsql?

2009-02-27 Thread Merlin Moncure
On Fri, Feb 27, 2009 at 12:00 PM, Enrico Sirola enrico.sir...@gmail.com wrote: Hello, I'm having some troubles with the correct use of the execute plpgsql statement. Where I work, we have a postgresql db hosting a set of schemas all with the same tables and, from time to time, we upgrade the

Re: [GENERAL] strange performance problem

2009-02-27 Thread Richard Huxton
Linos wrote: Richard Huxton escribió: Linos wrote: 2009-02-27 13:51:15 CET 127.0.0.1LOG: duración: 4231.045 ms sentencia: SELECT nombre, subfamilia_id, id_familia, hasta, foto, id_seccion, id_categoria FROM modelo_subfamilia PSQL with \timing: -development: Time: 72,441 ms -server:

Re: [GENERAL] Question about no unchanging update rule + ALTER

2009-02-27 Thread Josh Trutwin
On Fri, 27 Feb 2009 09:34:08 + Richard Huxton d...@archonet.com wrote: CREATE TRIGGER prevent_empty_updates BEFORE UPDATE ON test FOR EACH ROW EXECUTE PROCEDURE prevent_empty_updates(); Actually after writing this, this TOO does not seem to work after an ADD COLUMN. :/ Any

Re: [GENERAL] strange performance problem

2009-02-27 Thread Linos
Richard Huxton escribió: Linos wrote: Richard Huxton escribió: Linos wrote: 2009-02-27 13:51:15 CET 127.0.0.1LOG: duración: 4231.045 ms sentencia: SELECT nombre, subfamilia_id, id_familia, hasta, foto, id_seccion, id_categoria FROM modelo_subfamilia PSQL with \timing: -development: Time:

[GENERAL] max_fsm_relations

2009-02-27 Thread Gauthier, Dave
I just did a Vacuum Analyze on a DB. It worked OK, but I got... NOTICE: max_fsm_relations(1000) equals the number of relations checked HINT: You have at least 1000 relations. Consider increasing the configuration parameter max_fsm_relations I browsed around and learned that this has to do

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Joshua D. Drake
On Fri, 2009-02-27 at 12:37 -0700, Gauthier, Dave wrote: I just did a Vacuum Analyze on a DB. It worked OK, but I got... NOTICE: max_fsm_relations(1000) equals the number of relations checked HINT: You have at least 1000 relations. Consider increasing the configuration

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Bill Moran
In response to Gauthier, Dave dave.gauth...@intel.com: I just did a Vacuum Analyze on a DB. It worked OK, but I got... NOTICE: max_fsm_relations(1000) equals the number of relations checked HINT: You have at least 1000 relations. Consider increasing the configuration parameter

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Gauthier, Dave
There is no way I have 1000 tables/indexes. But maybe it's counting table/index file extensions in the mix? What's the metadata query to see these 1000 relations? -dave -Original Message- From: Bill Moran [mailto:wmo...@potentialtech.com] Sent: Friday, February 27, 2009 3:03 PM To:

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Bill Moran
In response to Gauthier, Dave dave.gauth...@intel.com: There is no way I have 1000 tables/indexes. But maybe it's counting table/index file extensions in the mix? What's the metadata query to see these 1000 relations? Are you counting tables, indexes, sequences, pg_toast tables, system

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Gauthier, Dave
Ya, most of it's system stuff. OK, I see where the 1000 comes from. I bumped it up to 1200 in postgresql.conf. Is there a way I can spin that in without rebooting the DB (and kicking my user off)? -dave -Original Message- From: Bill Moran [mailto:wmo...@potentialtech.com] Sent:

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Bill Moran
In response to Gauthier, Dave dave.gauth...@intel.com: Ya, most of it's system stuff. OK, I see where the 1000 comes from. I bumped it up to 1200 in postgresql.conf. Is there a way I can spin that in without rebooting the DB (and kicking my user off)? No. Unless something has changed

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Greg Smith
On Fri, 27 Feb 2009, Gauthier, Dave wrote: Is there a way I can spin that in without rebooting the DB (and kicking my user off)? Nope: # select name,context from pg_settings where name='max_fsm_pages'; name | context ---+ max_fsm_pages | postmaster That's

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Tom Lane
Bill Moran wmo...@potentialtech.com writes: In response to Gauthier, Dave dave.gauth...@intel.com: There is no way I have 1000 tables/indexes. But maybe it's counting table/index file extensions in the mix? What's the metadata query to see these 1000 relations? Are you counting tables,

Re: [GENERAL] max_fsm_relations

2009-02-27 Thread Gauthier, Dave
For the time being, I dropped a few tables in a scratch DB that I was experimenting with. I just reran the app that gave me the messages before and this time no messages. Tonight, I'll cycle the DB with the new fsm value. Thanks for all the help! (BTW, just have to say that the help I get