Re: [GENERAL] to_date() and invalid dates

2014-01-21 Thread Albe Laurenz
Thomas Kellerer wrote: >>> I asked this a while back already: >>> >>>select to_date('2013-02-31', '-mm-dd'); >>> >>> will not generate an error (unlike e.g. Oracle) >> >> This is by design. > > When I previously asked this question the answer as "this is based on > Oracle's to_date()": >

[GENERAL] pg_upgrade fails: "Mismatch of relation OID in database" - 9.2.4 to 9.3.2

2014-01-21 Thread Stefan Warten
I've tried to upgrade a large production database from 9.2.4 to 9.3.2 using pg_upgradecluster (using pg_upgrade method) and it fails with the error below. Upgrade using dump/restore seems to work on a test system but would require a too long downtime on the production system. # pg_upgradecluster -

Re: [GENERAL] Correct query to check streaming replication lag

2014-01-21 Thread Granthana Biswas
Hi Ray, We are already using the following query: SELECT CASE WHEN pg_last_xlog_receive_location( ) = pg_last_xlog_replay_location() THEN 0 ELSE EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp()) END AS log_delay; We cannot use pg_xlog_location_diff as we use postgresql 9.1. Regards,

Re: [GENERAL] Correct query to check streaming replication lag

2014-01-21 Thread Granthana Biswas
Thanks a load Michael. This is really helpful. Regards, Granthana On Tue, Jan 21, 2014 at 12:19 PM, Michael Paquier wrote: > > > On Tue, Jan 21, 2014 at 2:33 PM, Sameer Kumar > wrote: > >> > >> > >> We are already using the following query: > >> > >> SELECT CASE WHEN pg_last_xlog_receive_loc

Re: [GENERAL] Correct query to check streaming replication lag

2014-01-21 Thread Granthana Biswas
Yes byte lag as well as it makes more sense. Regards, Granthana Regards, Granthana On Tue, Jan 21, 2014 at 11:03 AM, Sameer Kumar wrote: > >> >> We are already using the following query: >> >> SELECT CASE WHEN pg_last_xlog_receive_location( >> ) = pg_last_xlog_replay_location() THEN 0 ELSE EXT

[GENERAL] Is there a way to address all elements of JSON array when creating a constraint in PosgreSQL?

2014-01-21 Thread Maciej Szopinski
Hello, Does PostgreSQL provide any notation/method for putting a constraint on each element of a JSON array? An example to illustrate: create table orders(data json); insert into orders values (' { "order_id": 45, "products": [ { "product_id": 1, "name":

Re: [GENERAL] pg_upgrade fails: "Mismatch of relation OID in database" - 9.2.4 to 9.3.2

2014-01-21 Thread Adrian Klaver
On 01/21/2014 05:42 AM, Stefan Warten wrote: I've tried to upgrade a large production database from 9.2.4 to 9.3.2 using pg_upgradecluster (using pg_upgrade method) and it fails with the error below. Upgrade using dump/restore seems to work on a test system but would require a too long downtime o

[GENERAL] UDP Overflow / UDP Drops on Standby Postgres Service

2014-01-21 Thread Postgres Question
Postgres General List, I am stumped trying to prevent an overflowing UDP buffer on a standby Postgres service. Any help would be most appreciated. Essentially a UDP buffer associated with the pg_standby process on my localhost interface gradually fills up once I start Postgres until it

[GENERAL] client_min_messages not suppressing messages in psql nor pgAdminIII

2014-01-21 Thread Kevin Field
This is a cross-post from http://stackoverflow.com/questions/21238209/info-output-despite-set-client-min-messages-to-warning-just-before since I'm not getting any answers there yet. With postgresql-9.0.15 on CentOS 6.5 (accessed via pgAdminIII 1.18.1 on Win2003), I have a plperlu function that

Re: [GENERAL] pg_upgrade fails: "Mismatch of relation OID in database" - 9.2.4 to 9.3.2

2014-01-21 Thread Stefan Warten
Ubuntu 12.04.2 LTS with packages from apt.postgresql.org repo. pg_upgradecluster is the one from postgresql-common=151.pgdg12.4+1. On 21.01.2014 16:36, Adrian Klaver wrote: > On 01/21/2014 05:42 AM, Stefan Warten wrote: >> I've tried to upgrade a large production database from 9.2.4 to 9.3.2 >> u

Re: [GENERAL] client_min_messages not suppressing messages in psql nor pgAdminIII

2014-01-21 Thread Jeff Janes
On Tue, Jan 21, 2014 at 7:57 AM, Kevin Field wrote: > This is a cross-post from http://stackoverflow.com/ > questions/21238209/info-output-despite-set-client-min- > messages-to-warning-just-before since I'm not getting any answers there > yet. > > With postgresql-9.0.15 on CentOS 6.5 (accessed vi

Re: [GENERAL] client_min_messages not suppressing messages in psql nor pgAdminIII

2014-01-21 Thread Tom Lane
Jeff Janes writes: > Why not use NOTICE? INFO is supposed to be used for things the user > *requested* to see (for example, by supplying the "verbose" option to one > of the commands which take that option). > The documentation could be clearer on this, but it seems to suggest that > there is no

Re: [GENERAL] UDP Overflow / UDP Drops on Standby Postgres Service

2014-01-21 Thread Tom Lane
Postgres Question writes: > Essentially a UDP buffer associated with the pg_standby process on my > localhost interface gradually fills up once I start Postgres until it > hits its maximum capacity and then proceeds to steadily drop packets. A > restart of Postgres (of course) clears the buffer, b

Re: [GENERAL] pg_upgrade fails: "Mismatch of relation OID in database" - 9.2.4 to 9.3.2

2014-01-21 Thread Adrian Klaver
On 01/21/2014 08:13 AM, Stefan Warten wrote: Ubuntu 12.04.2 LTS with packages from apt.postgresql.org repo. pg_upgradecluster is the one from postgresql-common=151.pgdg12.4+1. Alright I see --method is there, just not in the man pages I was looking at. Reading through the script I see it will

Re: [GENERAL] Is there a way to address all elements of JSON array when creating a constraint in PosgreSQL?

2014-01-21 Thread Joel Hoffman
On Tue, Jan 21, 2014 at 1:34 AM, Maciej Szopinski wrote: > Hello, > > Does PostgreSQL provide any notation/method for putting a constraint on > each element of a JSON array? > > An example to illustrate: > > > [...] > I know that this can be done by extracting products to a separate table > with

Re: [GENERAL] client_min_messages not suppressing messages in psql nor pgAdminIII

2014-01-21 Thread Kevin Field
Why not use NOTICE? INFO is supposed to be used for things the user *requested* to see (for example, by supplying the "verbose" option to one of the commands which take that option). The documentation could be clearer on this, but it seems to suggest that there is no way to turn off INFO to th

[GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Ken Tanzer
Hi. I'm trying to build the table_log module for Postgres 9.3, and am wondering if there is an issue with pg_config. I installed Postgres on a fresh CentOS 6.5 with the pgdg packages: yum list installed postgres* Installed Packages postgresql93.x86_64 9.3.2-1P

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Tom Lane
Ken Tanzer writes: > When I look the output of pg_config, and especially compared to my 9.2 > output, it seems suspiciously lacking some 9.3 paths: > [root@new-agency table_log-0.4.4]# pg_config | more > BINDIR = /usr/bin > DOCDIR = /usr/share/doc/pgsql > HTMLDIR = /usr/share/doc/pgsql > INCLUDED

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Ken Tanzer
On Tue, Jan 21, 2014 at 12:32 PM, Tom Lane wrote: > > Exactly where is root's path finding pg_config? > > IIRC, most of the paths shown here are actually computed relative to the > location of the pg_config executable, so I could imagine getting this > kind of result if you'd done something like

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Tom Lane
Ken Tanzer writes: > On Tue, Jan 21, 2014 at 12:32 PM, Tom Lane wrote: >> IIRC, most of the paths shown here are actually computed relative to the >> location of the pg_config executable, so I could imagine getting this >> kind of result if you'd done something like symlinking pg_config into >> /

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Adrian Klaver
On 01/21/2014 01:18 PM, Ken Tanzer wrote: On Tue, Jan 21, 2014 at 12:32 PM, Tom Lane Oddly, there was a pg_config in /usr/bin that was not a symlink and not owned by any package. I'm really puzzled as to how it got there, but I removed it, and symlinked the one from /usr/pgsql-9.3/bin. It pu

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Ken Tanzer
On Tue, Jan 21, 2014 at 1:45 PM, Tom Lane wrote: > Ken Tanzer writes: > > On Tue, Jan 21, 2014 at 12:32 PM, Tom Lane wrote: > >> IIRC, most of the paths shown here are actually computed relative to the > >> location of the pg_config executable, so I could imagine getting this > >> kind of resul

[GENERAL] CREATE EXTENSION does not seem to work in 9.2

2014-01-21 Thread Susan Cassidy
When I tried to do CREATE EXTENSION IF NOT EXISTS /usr/pgsql-9.2/share/extension/plpgsql.control with schema public; it gave me ERROR: syntax error at or near "EXTENSION" CREATE LANGUAGE worked just fine. I only tried CREATE EXTENSION because the manual said that CREATE LANGUAGE was deprecated.

Re: [GENERAL] CREATE EXTENSION does not seem to work in 9.2

2014-01-21 Thread Adrian Klaver
On 01/21/2014 02:51 PM, Susan Cassidy wrote: When I tried to do CREATE EXTENSION IF NOT EXISTS /usr/pgsql-9.2/share/extension/plpgsql.control with schema public; it gave me ERROR: syntax error at or near "EXTENSION" CREATE LANGUAGE worked just fine. I only tried CREATE EXTENSION because the m

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Tom Lane
Ken Tanzer writes: > On Tue, Jan 21, 2014 at 1:45 PM, Tom Lane wrote: >> Ken Tanzer writes: >>> It also sounds like from your comment that symlinking to /usr/bin is >>> frowned upon. What is the better way to deal with this? >> I had forgotten the details, but if pg_config is giving you the ri

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Devrim GÜNDÜZ
Hi, On Tue, 2014-01-21 at 13:18 -0800, Ken Tanzer wrote: > Oddly, there was a pg_config in /usr/bin that was not a symlink and > not owned by any package. I'm really puzzled as to how it got there, > but I removed it, and symlinked the one from /usr/pgsql-9.3/bin. It > puts out better informat

Re: [GENERAL] pg_upgrade & tablespaces

2014-01-21 Thread Bruce Momjian
On Mon, Jan 13, 2014 at 09:23:09AM -0500, Joseph Kregloh wrote: > > > > Right.  I know there were multiple issue with this upgrade, jails > probably being the biggest, but a new one I had never heard is that _if_ > you are placing your tablespaces in the PGDATA directory, and you are

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Ken Tanzer
On Tue, Jan 21, 2014 at 3:16 PM, Devrim GÜNDÜZ wrote: > > Hi, > > On Tue, 2014-01-21 at 13:18 -0800, Ken Tanzer wrote: > > > Oddly, there was a pg_config in /usr/bin that was not a symlink and > > not owned by any package. I'm really puzzled as to how it got there, > > but I removed it, and syml

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Tom Lane
Ken Tanzer writes: > On Tue, Jan 21, 2014 at 3:16 PM, Devrim GÜNDÜZ wrote: >> Please don't do it. PGDG RPMs are designed for parallel installation >> (like 9.2 and 9.3 on the same machine), and then the pg_config in >> regular $PATH might be tricky. > It didn't seem like a great idea to me eithe

Re: [GENERAL] pg_config problems on PG9.3/Centos?

2014-01-21 Thread Devrim GÜNDÜZ
Hi, On Tue, 2014-01-21 at 18:00 -0800, Ken Tanzer wrote: > It didn't seem like a great idea to me either, but what's the better > alternative? Without the symlink I get lots of errors: > > make USE_PGXS=1 > make: pg_config: Command not found Sometimes exporting PG_CONFIG does the trick. Altern