Re: [GENERAL] string = any()

2012-01-11 Thread Filip Rembiałkowski
W dniu 10 stycznia 2012 22:52 użytkownik David Johnston napisał: > If you are going to supply one parameter per "possible value" anyway skip the > whole "ANY" and "ARRAY" and just say " 'bob' IN ($1, $2 [,...]) "; true :-) prepare($sql); $stmt->execute($names); ?> PHP from several years cries

[GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
Hi all, we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in each schema, generated automatically. When adding a new PostGIS layer in QGis, the application obviously enumerates all tables, and this takes minutes. Even browsing the database in pgAdmin3 is horribly slow -- it

Re: [GENERAL] Can a function return more then one table?

2012-01-11 Thread Sergey Konoplev
On Wed, Jan 11, 2012 at 10:47 AM, Pavel Stehule wrote: > * return setof refcursors > * use arrays instead tables and returns arrays (for tables less 1 rows) One more option is to use hstore plus populate_record(). > > Regards > > Pavel Stehule > >> Mike >> >> -- >> Sent via pgsql-general mai

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Guillaume Lelarge
On Wed, 2012-01-11 at 11:07 +0100, Kirill Müller wrote: > Hi all, > > we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in > each schema, generated automatically. When adding a new PostGIS layer in > QGis, the application obviously enumerates all tables, and this takes > min

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Andres Freund
On Wednesday, January 11, 2012 11:07:23 AM Kirill Müller wrote: > Hi all, > > we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in > each schema, generated automatically. When adding a new PostGIS layer in > QGis, the application obviously enumerates all tables, and this takes

Re: [GENERAL] pgAdmin - Query - out of memory for query result

2012-01-11 Thread Guillaume Lelarge
On Wed, 2012-01-11 at 01:10 -0500, Kevin Duffy wrote: > [...] > I have run into a very frustrating problem. > > I have a database with some tables which were loaded from Excel spreadsheets > via a Perl script. Guess that does not really matter. The table > definitions > are below. > > Both tabl

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Guillaume Lelarge
On Wed, 2012-01-11 at 14:44 +0100, Andres Freund wrote: > On Wednesday, January 11, 2012 11:07:23 AM Kirill Müller wrote: > > Hi all, > > > > we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in > > each schema, generated automatically. When adding a new PostGIS layer in > > QG

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Andres Freund
On Wednesday, January 11, 2012 02:53:06 PM Guillaume Lelarge wrote: > On Wed, 2012-01-11 at 14:44 +0100, Andres Freund wrote: > > On Wednesday, January 11, 2012 11:07:23 AM Kirill Müller wrote: > > > Hi all, > > > > > > we have a Postgres/PostGIS database with 100+ schemas and 200+ tables > > > in

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Guillaume Lelarge
On Wed, 2012-01-11 at 15:10 +0100, Andres Freund wrote: > On Wednesday, January 11, 2012 02:53:06 PM Guillaume Lelarge wrote: > > On Wed, 2012-01-11 at 14:44 +0100, Andres Freund wrote: > > > On Wednesday, January 11, 2012 11:07:23 AM Kirill Müller wrote: > > > > Hi all, > > > > > > > > we have a

[GENERAL] PGAdmin3 for CentOS-5_186_64 and pgdg91

2012-01-11 Thread James B. Byrne
I need a version of pgadmin4 which can handle pg-9.1 and which runs on RHEL5_186_64 architectures. I have installed the pgdg-91-centos.repo yum repo file from pgdgrpm.org. However: yum whatprovides */pgadmin3 --enablerepo=pgdg91 does not return anything. If I do exactly the same thing on a Cen

Re: [GENERAL] PGAdmin3 for CentOS-5_186_64 and pgdg91

2012-01-11 Thread Devrim GÜNDÜZ
Hi, On Wed, 2012-01-11 at 09:58 -0500, James B. Byrne wrote: > Does anyone reading this message know where I can get > pgadmin3_91-1.14.0-3.rhel5.i86_64 or why it is not > available from pgdgrpm.org? (Sorry for not replying you on pgadmin list and the private email) pgadmin3 cannot be built on

Re: [GENERAL] PGAdmin3 for CentOS-5_186_64 and pgdg91

2012-01-11 Thread devrim
This message has been digitally signed by the sender. Re___GENERAL__PGAdmin3_for_CentOS_5_186_64_and_pgdg91.eml Description: Binary data - Hi-Tech Gears Ltd, Gurgaon, India -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] pgAdmin - Query - out of memory for query result

2012-01-11 Thread Kevin Duffy
I am using pgAdmin on both machines. And for some strange reason the query fails on the machine with more memory. The message shows up in the Output pane in the messages tab. I do not get it. KD On Wed, Jan 11, 2012 at 8:50 AM, Guillaume Lelarge wrote: > On Wed, 2012-01-11 at 01:10 -0500, Ke

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Adrian Klaver
On Wednesday, January 11, 2012 2:07:23 am Kirill Müller wrote: > Hi all, > > we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in > each schema, generated automatically. When adding a new PostGIS layer in > QGis, the application obviously enumerates all tables, and this takes >

[GENERAL] question about the money type

2012-01-11 Thread Szymon Guz
Hi, in the documentation for 8.2 ( http://www.postgresql.org/docs/8.2/interactive/datatype-money.html) there is info: *Note:* The money type is deprecated. Use numeric or decimal instead, in combination with theto_char function. However in later versions the info disappeared. It doesn't exist eve

Re: [GENERAL] Mixed Pg-9.1.2 and 8.4.4 environment

2012-01-11 Thread James B. Byrne
On Tue, January 10, 2012 09:28, Adrian Klaver wrote: > On Tuesday, January 10, 2012 6:17:27 am James B. Byrne > wrote: >> >> My question: Is their a way to specify a pg_dump option >> to retain compatibility with a lower version pg >> database? >> Alternatively, can one install a higher level pg_

[GENERAL] add constraint deferrable, syntax error

2012-01-11 Thread Gauthier, Dave
Why am I getting this? xdb=# alter table templates add constraint manager_uid_is_invalid check ((constraint_checker('manager',manager,null,null)) = 'OK') DEFERRABLE ; ERROR: syntax error at or near "DEFERRABLE" LINE 1: ...int_checker('manager',manager,null,null)) = 'OK') DEFERRABLE... v8.3.4 on

Re: [GENERAL] question about the money type

2012-01-11 Thread Merlin Moncure
On Wed, Jan 11, 2012 at 9:32 AM, Szymon Guz wrote: > Hi, > in the documentation for 8.2 > (http://www.postgresql.org/docs/8.2/interactive/datatype-money.html) there > is info: > > Note: The money type is deprecated. Use numeric or decimal instead, in > combination with theto_char function. > > How

[GENERAL] Keywords

2012-01-11 Thread vyang
Hello List, I’m wondering if there is a way to retrieve/query PostgreSQL for a list of key words matching that of Appendix C. SQL Key Words. I’m using PostgreSQL 9.1 and java. I’ve already tried java’s DatabaseMetaData.getSQLKeywords, but the API states “Retrieves a comma-separated list of al

Re: [GENERAL] Keywords

2012-01-11 Thread Adam Cornett
On Wed, Jan 11, 2012 at 11:03 AM, vyang wrote: > Hello List, > > I’m wondering if there is a way to retrieve/query PostgreSQL for a list of > key words matching that of Appendix C. SQL Key Words. I’m using PostgreSQL > 9.1 and java. I’ve already tried java’s DatabaseMetaData.getSQLKeywords, >

Re: [GENERAL] Keywords

2012-01-11 Thread Dmitriy Igrishin
Hey vyang, 2012/1/11 vyang > Hello List, > > I’m wondering if there is a way to retrieve/query PostgreSQL for a list of > key words matching that of Appendix C. SQL Key Words. I’m using PostgreSQL > 9.1 and java. I’ve already tried java’s DatabaseMetaData.getSQLKeywords, > but the API states

Re: [GENERAL] Keywords

2012-01-11 Thread Adam Cornett
On Wed, Jan 11, 2012 at 12:02 PM, Adam Cornett wrote: > On Wed, Jan 11, 2012 at 11:03 AM, vyang wrote: > >> Hello List, >> >> I’m wondering if there is a way to retrieve/query PostgreSQL for a list >> of key words matching that of Appendix C. SQL Key Words. I’m using >> PostgreSQL 9.1 and java

[GENERAL] indexes no longer used after shutdown during reindexing

2012-01-11 Thread Matt Dew
Hello all, I have a database that was shut down, cleanly, during an 'reindex table' command. When the database came back up, queries against that table started doing sequential scans instead of using the indexes as they had been up until that point. We tried: 1) vacuuming the table (vacu

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Scott Marlowe
On Wed, Jan 11, 2012 at 3:07 AM, Kirill Müller wrote: > Hi all, > > we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in > each schema, generated automatically. When adding a new PostGIS layer in > QGis, the application obviously enumerates all tables, and this takes > minutes.

Re: [GENERAL] add constraint deferrable, syntax error

2012-01-11 Thread Andreas Kretschmer
Gauthier, Dave wrote: > Why am I getting this? > > > > xdb=# alter table templates add constraint manager_uid_is_invalid check > ((constraint_checker('manager',manager,null,null)) = 'OK') DEFERRABLE ; > > ERROR: syntax error at or near "DEFERRABLE" > > LINE 1: ...int_checker('manager',mana

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-11 Thread Scott Marlowe
On Wed, Jan 11, 2012 at 10:42 AM, Matt Dew wrote: > Hello all, >   I have a database that was shut down, cleanly, during an 'reindex table' >  command.  When the database came back up, queries against that table > started doing sequential scans instead of using the indexes as they had been > up un

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-11 Thread Matt Dew
On 01/11/2012 11:07 AM, Scott Marlowe wrote: On Wed, Jan 11, 2012 at 10:42 AM, Matt Dew wrote: Hello all, I have a database that was shut down, cleanly, during an 'reindex table' command. When the database came back up, queries against that table started doing sequential scans instead of

Re: [GENERAL] Keywords

2012-01-11 Thread vyang
From: Adam Cornett Sent: Wednesday, January 11, 2012 11:05 AM To: vyang Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Keywords I want to grab it programmatically because from time to time words are added/removed. On Wed, Jan 11, 2012 at 12:02 PM, Adam Cornett wrote: On Wed, Jan

Re: [GENERAL] Keywords

2012-01-11 Thread vyang
That works perfectly. Thanks!! From: Dmitriy Igrishin Sent: Wednesday, January 11, 2012 11:03 AM To: vyang Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Keywords Hey vyang, 2012/1/11 vyang Hello List, I’m wondering if there is a way to retrieve/query PostgreSQL for a list o

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
Adrian, On 01/11/2012 04:32 PM, Adrian Klaver wrote: Would seem that they both have the same issue, namely pulling over the table names and the meta data is resource intensive. The problem is that the slow part is the "connect", just at the * in the in-line comment :-) 4.2.2. Loading a Po

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
On 01/11/2012 02:44 PM, Andres Freund wrote: On Wednesday, January 11, 2012 11:07:23 AM Kirill Müller wrote: Hi all, we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in each schema, generated automatically. When adding a new PostGIS layer in QGis, the application obviously

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Pavel Stehule
2012/1/11 Kirill Müller : > On 01/11/2012 02:44 PM, Andres Freund wrote: >> >> On Wednesday, January 11, 2012 11:07:23 AM Kirill Müller wrote: >>> >>> Hi all, >>> >>> we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in >>> each schema, generated automatically. When adding a new

Re: [GENERAL] Is there a reason why Postgres doesn't have Byte or tinyint?

2012-01-11 Thread Francisco Figueiredo Jr.
On Tue, Jan 10, 2012 at 03:49, Mike Christensen wrote: According to the manuals, Postgres has smallint (2 byte), integer (4 bytes) and bigint (8 bytes)..  I use a lot of structures with "bytes" in my code and it's kinda annoying to

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Adrian Klaver
On 01/11/2012 11:45 AM, Kirill Müller wrote: Adrian, On 01/11/2012 04:32 PM, Adrian Klaver wrote: Would seem that they both have the same issue, namely pulling over the table names and the meta data is resource intensive. The problem is that the slow part is the "connect", just at the * i

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Reid Thompson
On Wed, 2012-01-11 at 20:50 +0100, Kirill Müller wrote: > that would > allow tracing the queries and their runtime while they are executed \ http://www.postgresql.org/docs/8.4/static/auto-explain.html -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
On 01/11/2012 09:36 PM, Adrian Klaver wrote: On 01/11/2012 11:45 AM, Kirill Müller wrote: On 01/11/2012 04:32 PM, Adrian Klaver wrote: Would seem that they both have the same issue, namely pulling over the table names and the meta data is resource intensive. The problem is that the slow part

[GENERAL] Problemas ao salvar endereços de rede.

2012-01-11 Thread giuliano.medina
Bom dia pessoal, Estou passando por um problema semelhante, mas com duas versões de base de dados diferentes. Se eu rodar, na versão 'PostgreSQL 8.4.4, compiled by Visual C++ build 1400, 32-bit', o comando: insert into escape(texto) values ( 'caminho\\rede\\arquivo.txt'); o pgadmin me ret

[GENERAL] PG synchronous replication and unresponsive slave

2012-01-11 Thread Manoj Govindassamy
Hi, I have a PG 9.1.2 Master <--> Slave with synchronous replication setup. They are all working fine as expected. I do have a case where I want to flip Master to non replication mode whenever its slave is not responding. I have set replication_timeout to 5s and whenever salve is not respondi

[GENERAL] Parameterized Query Pegs the DB

2012-01-11 Thread Michael Daines
Hi, I've got a situation where a user was seeing their database pegged at 100% CPU usage. We tracked it down to a parameterized query, and when we removed the process that was launching the query, it solved the problem. I still don't understand what caused the problem, though. I've searched aro

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
On 01/11/2012 07:00 PM, Scott Marlowe wrote: This is a problem I've run into before, but I can't find the previous post on it. When you run a \d command, if you run top on your server do you see a single CPU spinning hard on that one command? If so then it's a pg server side problem, which is w

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-11 Thread Tom Lane
Matt Dew writes: > I have a database that was shut down, cleanly, during an 'reindex > table' command. When the database came back up, queries against that > table started doing sequential scans instead of using the indexes as > they had been up until that point. What exactly is your def

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Kirill Müller Sent: Wednesday, January 11, 2012 6:28 PM To: pgsql-general@postgresql.org Cc: Scott Marlowe Subject: Re: [GENERAL] Enumeration of tables is very slow in largis

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
I am impressed. Execution time dropped to less than one second. Thanks a lot! On 01/12/2012 12:43 AM, David Johnston wrote: I only see one (1) "AND NOT EXISTS" in the provided query. Sorry, there used to be two "AND NOT EXISTS", but I edited the query without updating the text. Syntax may be

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread David Johnston
-Original Message- From: Kirill Müller [mailto:kirill.muel...@ivt.baug.ethz.ch] Sent: Wednesday, January 11, 2012 7:11 PM To: David Johnston Cc: pgsql-general@postgresql.org; 'Scott Marlowe' Subject: Re: [GENERAL] Enumeration of tables is very slow in largish database I am impressed. Exec

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Tom Lane
=?ISO-8859-1?Q?Kirill_M=FCller?= writes: > Thanks for the feedback. I found the relevant parts in the qgis source > code and have been able to trace the problem. It's just a sub-optimal > query issued by qgis: > SELECT > pg_class.relname,pg_namespace.nspname,pg_attribute.attname,pg_class.relki

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
On 01/12/2012 01:34 AM, Tom Lane wrote: =?ISO-8859-1?Q?Kirill_M=FCller?= writes: When leaving out the last two "AND NOT EXISTS..." parts, the query finishes in no time. I have attached the output of EXPLAIN ANALYZE -- if I understand the execution tree correctly, the time is burnt in repeated s

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Tom Lane
=?ISO-8859-1?Q?Kirill_M=FCller?= writes: > On 01/12/2012 01:34 AM, Tom Lane wrote: >> This is probably an indication of eqjoinsel_semi doing the wrong thing; >> we've whacked that estimator around a few times now, so it's hard to >> know whether this represents an already-fixed bug or not. What P

Re: [GENERAL] Enumeration of tables is very slow in largish database

2012-01-11 Thread Kirill Müller
On 01/12/2012 02:02 AM, Tom Lane wrote: There were fixes for that in 8.4.9, so I'd be interested to know if you get a better estimate in a more up-to-date version. I'll ask our administrator to update the server, but this might take a while. I'll get back to you when I know more. Regards Ki

[GENERAL] How to return latest results without a polygon intersect?

2012-01-11 Thread David Waddy
If I have a table of the following form: id (integer) event_time (timestamp) lat_lon (polygon) 3497 1977-01-01 00:00:00 ((-64.997,45.975),(,(-64.9981,45.975),(-64.8981,45.875),(-64.9978,45.9751)) 3431 2007-06-06 01:00:00 ((-64.971,45.982),(-64.921,45.982),(-64.972,45.982),(-64.973,45.98209),(

[GENERAL] Compiling C function with VC++ for Windows version

2012-01-11 Thread Edwin Quijada
Hi!I am trying to create a C function for windows in Postgres compiling with VC++ 2008 Express Edition. I did this function for Linux without problem using gcc and tried to do the same in Windows but in Windows was imposible. The function compile fine but when I tried to run from Postgres it do

Re: [GENERAL] How to return latest results without a polygon intersect?

2012-01-11 Thread Andy Colson
On 01/11/2012 07:14 PM, David Waddy wrote: If I have a table of the following form: id (integer) event_time (timestamp) lat_lon (polygon) 3497 1977-01-01 00:00:00 ((-64.997,45.975),(,(-64.9981,45.975),(-64.8981,45.875),(-64.9978,45.9751)) 3431 2007-06-06 01:00:00 ((-64.971,45.982),(-64.921,

Re: [GENERAL] Compiling C function with VC++ for Windows version

2012-01-11 Thread Craig Ringer
On 12/01/12 11:06, Edwin Quijada wrote: > Hi! > I am trying to create a C function for windows in Postgres compiling > with VC++ 2008 Express Edition. I did this function for Linux without > problem using gcc and tried to do the same in Windows but in Windows > was imposible. The function compile f