Re: [GENERAL] Replication: How to query current segments allocation relative to "Wal keep segments"?

2015-01-04 Thread Michael Paquier
On Sun, Jan 4, 2015 at 1:48 AM, Edson Carlos Ericksson Richter wrote: > How to query current segments allocation relative to "Wal keep segments" in > each master server? What is your server version? You can have a look at pg_stat_replication on the master which contains information about the WAL

Re: [GENERAL] Streaming replication - slave not getting promoted

2015-01-04 Thread Adrian Klaver
On 01/04/2015 06:54 PM, Jayadevan M wrote: On Sun, Jan 4, 2015 at 8:01 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: That was indeed the case. I had copied/pasted the code in Microsoft Word and then copied/pasted from Word to recovery.conf. Word intelligently (?) changed the 'q

Re: [GENERAL] Streaming replication - slave not getting promoted

2015-01-04 Thread Jayadevan M
On Sun, Jan 4, 2015 at 8:01 PM, Adrian Klaver wrote: > On 01/04/2015 06:09 AM, Jayadevan M wrote: > >> Hi, >> I have streaming replication set up, with PostgreSQL 9.3. The entries in >> recovery.conf on the slave are as follows - >> standby_mode = 'on' >> primary_conninfo = 'host=127.0.0.1 port=2

Re: [GENERAL] group by of multi columns

2015-01-04 Thread Flyingfox Lee
Thank you, this works like a charm. On 2015年1月4日周日 20:01 Andreas Kretschmer wrote: > Flyingfox Lee wrote: > > > I am doing a `group by` on a table with ~ 3 million rows, the code is > simply > > `select A, B, C, D,E count(1) from t group by A, B, C, D, E order by > 6`, it > > takes ~ 3 minutes

[GENERAL] Meetups in New Zealand Jan 12 to 20

2015-01-04 Thread Josh Berkus
Folks: Since NZPUG hasn't had any meetups in a while, I've organized some around my upcoming visits to Auckland and Wellington. If you live in either of those cities, please RSVP to the appropriate event. https://wiki.postgresql.org/wiki/Nzpug -- Josh Berkus PostgreSQL Experts Inc. http://pgex

Re: [GENERAL] libpq: why only one PQsendQuery per connection at a time?

2015-01-04 Thread Dmitry Igrishin
2015-01-04 19:02 GMT+03:00 : > Hello! > Question generally to (libpq) developers. > > According to http://www.postgresql.org/docs/9.4/static/libpq-async.html: > "PQsendQuery cannot be called again (on the same connection) until > PQgetResult > has returned a null pointer, indicating that the comma

Re: [GENERAL] libpq: why only one PQsendQuery per connection at a time?

2015-01-04 Thread David G Johnston
sftf-2 wrote > So question is why this limitaion exists? > > Why PQgetResult(PGconn *conn) operates on connection, > and not on some unique handler that each "PQsend*" could return. > > Is it limitaion of libpq or architecture of postgresql backend or > backend-frontend protocol? IIUC this is a

[GENERAL] libpq: why only one PQsendQuery per connection at a time?

2015-01-04 Thread sftf-misc
Hello! Question generally to (libpq) developers. According to http://www.postgresql.org/docs/9.4/static/libpq-async.html: "PQsendQuery cannot be called again (on the same connection) until PQgetResult has returned a null pointer, indicating that the command is done." As I guess this is also true

Re: [GENERAL] Streaming replication - slave not getting promoted

2015-01-04 Thread Andreas Kretschmer
Jayadevan M wrote: > > Replication is working fine. The trigger file does get created by the failover > script when I shut down the primary. But I just keep getting these entries in > the log file in the slave and it does not get promoted. > FATAL:  could not connect to the primary server: could

Re: [GENERAL] Streaming replication - slave not getting promoted

2015-01-04 Thread Adrian Klaver
On 01/04/2015 06:09 AM, Jayadevan M wrote: Hi, I have streaming replication set up, with PostgreSQL 9.3. The entries in recovery.conf on the slave are as follows - standby_mode = 'on' primary_conninfo = 'host=127.0.0.1 port=2345 user=postgres password=password' restore_command = 'cp /pgdata/archi

[GENERAL] Streaming replication - slave not getting promoted

2015-01-04 Thread Jayadevan M
Hi, I have streaming replication set up, with PostgreSQL 9.3. The entries in recovery.conf on the slave are as follows - standby_mode = 'on' primary_conninfo = 'host=127.0.0.1 port=2345 user=postgres password=password' restore_command = 'cp /pgdata/archive/%f "%p"' trigger_file = ‘/tmp/down.trg’ I

Re: [GENERAL] group by of multi columns

2015-01-04 Thread Andreas Kretschmer
Flyingfox Lee wrote: > I am doing a `group by` on a table with ~ 3 million rows, the code is simply > `select A, B, C, D,E count(1) from t group by A, B, C, D, E order by 6`,  it > takes ~ 3 minutes for this operation and there are ~ 500 rows returned. So, to > speed this up, should I add a compo

Re: [GENERAL] partial "on-delete set null" constraint

2015-01-04 Thread Rafal Pietrak
W dniu 04.01.2015 o 02:02, Alban Hertroys pisze: [--] "A table can have at most one primary key, but it may have more than one candidate key. A primary key is a combination of columns which uniquely specify a row; it is a special case of unique keys. One difference

[GENERAL] group by of multi columns

2015-01-04 Thread Flyingfox Lee
I am doing a `group by` on a table with ~ 3 million rows, the code is simply `select A, B, C, D,E count(1) from t group by A, B, C, D, E order by 6`, it takes ~ 3 minutes for this operation and there are ~ 500 rows returned. So, to speed this up, should I add a composite index on A, B, C, D, E or