Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Dmitry Samonenko
So, should I fill a bug report? With regards, Dmitry Samonenko.

Re: [GENERAL] Error while upgrading from 8.4 to 9.3

2014-05-30 Thread Bruce Momjian
On Wed, May 28, 2014 at 11:28:47PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Wed, May 28, 2014 at 04:56:53PM -0700, Adrian Klaver wrote: > >> So for my edification, does that mean -O ' -c > >> config_file=/etc/postgresql/9.3/main/postgresql.conf' could cause a > >> problem or that st

Re: [GENERAL] Data Checksum feature and streaming replication

2014-05-30 Thread Martín Marqués
2014-05-24 8:54 GMT-03:00 Jack Douglas : > > If I’m using the Data Checksum feature (new to 9.3: > https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3#Data_Checksums), > and in the event of a checksum failure on a replication master, will that > corrupt data replicate to slaves or will

Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Tom Lane
Dmitry Samonenko writes: > So, should I fill a bug report? [ shrug... ] This is not a bug. It might be a feature request, but I doubt that it's a feature anybody would be interested in implementing. Adding timeouts to libpq would mean adding hard-to-test (and therefore easy-to-break) logic paths

[GENERAL] Replication failover on windows

2014-05-30 Thread CS_DBA
Hi all; we have a client running PostgreSQL on windows, and they want to run streaming replication with some sort of failover. We have streaming replication in place, we thought we could use pgbouncer and in the case of the master being down our heartbeat script would reload the pgbouncer co

Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Dmitry Samonenko
On Fri, May 30, 2014 at 6:08 PM, Tom Lane wrote: [ shrug... ] This is not a bug. It might be a feature request, but > I doubt that it's a feature anybody would be interested in implementing. > Don't count me out. > Adding timeouts to libpq would mean adding hard-to-test (and therefore > easy-

[GENERAL] row_to_json on a subset of columns.

2014-05-30 Thread Chris Hanks
I'm using a JSON column to store some aggregate data, like so: UPDATE courses_table SET aggregates = agg.aggregates FROM ( SELECT course_id, row_to_json(sub) AS aggregates FROM ( SELECT course_id, avg(rating) AS rating, sum(reviews_count) AS reviews_count,

Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Martijn van Oosterhout
On Fri, May 30, 2014 at 07:48:00PM +0400, Dmitry Samonenko wrote: > > BTW, you might consider using libpq's nonblock mode to push the waiting > > out to the application level, and then you could just decide when you've > > waited too long for yourself. > > > Do you mean PQsendQuery / PQisBusy / PQg

[GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread reiner peterke
Hi, has anyone else had this issue and does any one know the solution? Since upgrading my mac from os x 10.8 to 10.9, i can no long build postgres with '--with-python’. i get the following error. ld: framework not found Python clang: error: linker command failed with exit code 1 (use -v to see

Re: [GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread Asif Naeem
Hi Reiner, Latest PG 9.4 source code seems building fine with --with-python option on my OS X 10.9.3 box i.e. pc1dotnetpk:inst asif$ find . | grep -i python > ./lib/plpython2.so > ./share/extension/plpython2u--1.0.sql > ./share/extension/plpython2u--unpackaged--1.0.sql > ./share/extension/plpyth

Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Dmitry Samonenko
On Fri, May 30, 2014 at 8:19 PM, Martijn van Oosterhout wrote: > I don't think the suggestion is to move to async command processing. I > think the suggestion is to use those methods to make a > PGgetResultWithTimeout() that does what you want. > > Have a nice day, > -- > Martijn van Oosterhout

Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Tom Lane
Dmitry Samonenko writes: > Yeah, that will work. Looks simple to implement in the client. Question is: > why don't you think it should be a part of the libpq's API? It's a must > have feature in high availability environments where only several minutes > of Out of Service per year are tolerable.

Re: [GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread Edoardo Panfili
Il 30/05/14 18:49, reiner peterke ha scritto: Hi, has anyone else had this issue and does any one know the solution? Since upgrading my mac from os x 10.8 to 10.9, i can no long build postgres with '--with-python’. i get the following error. ld: framework not found Python clang: error: linke

Re: [GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread Tom Lane
Asif Naeem writes: > On Fri, May 30, 2014 at 9:49 PM, reiner peterke > wrote: >> Since upgrading my mac from os x 10.8 to 10.9, i can no long build >> postgres with '--with-python’. > Latest PG 9.4 source code seems building fine with --with-python option on > my OS X 10.9.3 box i.e. [ pleas

Re: [GENERAL] row_to_json on a subset of columns.

2014-05-30 Thread Merlin Moncure
On Fri, May 30, 2014 at 11:16 AM, Chris Hanks wrote: > I'm using a JSON column to store some aggregate data, like so: > > UPDATE courses_table > SET aggregates = agg.aggregates > FROM ( > SELECT course_id, row_to_json(sub) AS aggregates > FROM ( > SELECT course_id,

Re: [GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread Adrian Klaver
On 05/30/2014 11:52 AM, Tom Lane wrote: Asif Naeem writes: On Fri, May 30, 2014 at 9:49 PM, reiner peterke wrote: Since upgrading my mac from os x 10.8 to 10.9, i can no long build postgres with '--with-python’. Latest PG 9.4 source code seems building fine with --with-python option on m

Re: [GENERAL] row_to_json on a subset of columns.

2014-05-30 Thread Chris Hanks
That works! Thanks! On Fri, May 30, 2014 at 11:59 AM, Merlin Moncure wrote: > On Fri, May 30, 2014 at 11:16 AM, Chris Hanks > wrote: >> I'm using a JSON column to store some aggregate data, like so: >> >> UPDATE courses_table >> SET aggregates = agg.aggregates >> FROM ( >> SELE

Re: Fwd: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread David G Johnston
Tom Lane-2 wrote > Dmitry Samonenko < > shreddingwork@ > > writes: >> Yeah, that will work. Looks simple to implement in the client. Question >> is: >> why don't you think it should be a part of the libpq's API? It's a must >> have feature in high availability environments where only several minu

Re: [HACKERS] [GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread Tom Lane
Adrian Klaver writes: > On 05/30/2014 11:52 AM, Tom Lane wrote: >> If you do the ld call by hand without the -syslibroot option, it works. >> AFAICS it could never have worked with such an option, so I'm thinking >> this is some new misbehavior in the latest version of Xcode. > There is and the S

Re: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Dmitry Samonenko
On Friday, May 30, 2014, David G Johnston wrote: > Tom Lane-2 wrote > > That argument seems nonsensical from here. If you need HA then you > should > > be using network service monitoring tools, not relying on some random > > libpq client to decide that its connection has been lost. I'm troub

Re: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-30 Thread Dmitry Samonenko
Sorry, my last mail got truncated. I'm starting to like Gmail mobile. On Saturday, May 31, 2014, Dmitry Samonenko wrote: > > >> Though this then begs the question: if the connection comes back up what >> happens in the client? > > > >> Depends on the state of the server. If problem was purely net

[GENERAL] database system was interrupted sometimes untill we restart it can be used

2014-05-30 Thread snowsnake
postgresql 8.1.11 we found the database can't be connected at 2014/5/9 23:00 and 2014/5/10 17:03 which you can see from below log. We checked the CUP and memory also, it is normal. And the server generated many postmaster process at the interrupted time. Untill we restart the database, it becomes n

[GENERAL] Archive# views

2014-05-30 Thread Satish K Biradar
Hello, I am a newbee to Postgresql and I want to build replication between master and slave servers(8.4). I was able to set it up but I cannot check archive# at master and slave servers as what was the last archive# generated at master and what is current archive# at Slave server that is being rep

Re: [GENERAL] Archive# views

2014-05-30 Thread Kapil Agarwal
Hi Satish, You can calculate the replication lag by comparing the current WAL write location on the primary with the last WAL location received/replayed by the standby. They can be retrieved using pg_current_xlog_location on the primary and the pg_last_xlog_receive_location/pg_last_xlog_replay_loc

Re: [GENERAL] database system was interrupted sometimes untill we restart it can be used

2014-05-30 Thread John R Pierce
On 5/30/2014 1:59 AM, snowsnake wrote: postgresql 8.1.11 hopelessly obsolete and long out of support. Also, note that 8.1 was updated until 8.1.23, so thats 12 bug release versions you've missed, but 8.4 is the oldest version currently in support, and its soon to be obsoleted. we fou

Re: [GENERAL] Archive# views

2014-05-30 Thread Ray Stell
On May 30, 2014, at 6:19 PM, Kapil Agarwal wrote: > Slave server: > > select pg_last_xlog_receive_location(); > not possible back in 8.4. you could just compare the output of the pg_controldata command on both hosts.

Re: [GENERAL] database system was interrupted sometimes untill we restart it can be used

2014-05-30 Thread Adrian Klaver
On 05/30/2014 01:59 AM, snowsnake wrote: postgresql 8.1.11 we found the database can't be connected at 2014/5/9 23:00 and 2014/5/10 17:03 which you can see from below log. We checked the CUP and memory also, it is normal. And the server generated many postmaster process at the interrupted time. U

Re: [HACKERS] [GENERAL] unable to build postgres-9.4 in os x 10.9 with python

2014-05-30 Thread Adrian Klaver
On 05/30/2014 01:31 PM, Tom Lane wrote: Adrian Klaver writes: On 05/30/2014 11:52 AM, Tom Lane wrote: If you do the ld call by hand without the -syslibroot option, it works. AFAICS it could never have worked with such an option, so I'm thinking this is some new misbehavior in the latest versio

[GENERAL] How is sorting work?

2014-05-30 Thread Quang Thoi
Any one knows how sorting works? I am using postgresql 9.3 and runs on Linux machines. I see different sorting order for the same set of return data. On linux machines, databases are configured the same. Database have encoding set to 'utf8' and locale='C' query: Select host_id, host_name from ho

Re: [GENERAL] How is sorting work?

2014-05-30 Thread Steve Atkins
On May 30, 2014, at 5:13 PM, Quang Thoi wrote: > Any one knows how sorting works? > > I am using postgresql 9.3 and runs on Linux machines. > I see different sorting order for the same set of return data. > > On linux machines, databases are configured the same. > Database have encoding set to

Re: [GENERAL] How is sorting work?

2014-05-30 Thread Quang Thoi
Thanks Steve! Just want to get confirmation that postgres does not use any special rules When no sorting order specified. Thanks, Quang. On 5/30/14 5:20 PM, "Steve Atkins" wrote: > >On May 30, 2014, at 5:13 PM, Quang Thoi wrote: > >> Any one knows how sorting works? >> >> I am using pos

Re: [GENERAL] How is sorting work?

2014-05-30 Thread David G Johnston
Quang Thoi wrote > Thanks Steve! > > Just want to get confirmation that postgres does not use any special rules > > When no sorting order specified. Didn't your testing prove that out sufficiently? I'd be more concerned, though, if you took random congruence between the two results (I.e. If