Re: [GENERAL] Repmgr + pgbouncer - Notification of master promotion to application level ...

2017-06-15 Thread Rory Campbell-Lange
On 15/06/17, Martin Goodson (kaema...@googlemail.com) wrote: > On 14/06/2017 19:54, Rory Campbell-Lange wrote: > >On 14/06/17, Martin Goodson (kaema...@googlemail.com) wrote: > >>The new master's repmgr promote script will execute commands to pause > >>pgbouncer, reconfigure pgbouncer to point to

Re: [GENERAL] Ordering of window functions with no order specified?

2017-06-15 Thread Ken Tanzer
Thanks for the replies! -- AGENCY Software A Free Software data system By and for non-profits *http://agency-software.org/ * *https://agency-software.org/demo/client * ken.tan...@agency-software.org (253) 245-3801 Subscribe

Re: [GENERAL] Repmgr + pgbouncer - Notification of master promotion to application level ...

2017-06-15 Thread Rory Campbell-Lange
On 15/06/17, Andreas Kretschmer (andr...@a-kretschmer.de) wrote: > > Am 15.06.2017 um 01:18 schrieb Martin Goodson: > > > >...Do people setup pgbouncer nodes on the database servers > >themselves, on application servers, in the middle tier between the > >application and database, and so forth, or

Re: [GENERAL] Repmgr + pgbouncer - Notification of master promotion to application level ...

2017-06-15 Thread Martin Goodson
On 15/06/2017 05:27, Andreas Kretschmer wrote: Am 15.06.2017 um 01:18 schrieb Martin Goodson: I'm just wondering how people may have implemented this. Do people setup pgbouncer nodes on the database servers themselves, on application servers, in the middle tier between the application and

Re: [GENERAL] Repmgr + pgbouncer - Notification of master promotion to application level ...

2017-06-15 Thread Andreas Kretschmer
Am 15.06.2017 um 11:57 schrieb Martin Goodson: The issues I think I would have with pgbouncer at the application level is ... 1) What if an application server is down when pgbouncer tries to update where the database IP is pointing to? When it is brought back into service could that

Re: [GENERAL] Repmgr + pgbouncer - Notification of master promotion to application level ...

2017-06-15 Thread Andreas Kretschmer
Am 15.06.2017 um 08:26 schrieb Rory Campbell-Lange: On 15/06/17, Andreas Kretschmer (andr...@a-kretschmer.de) wrote: Am 15.06.2017 um 01:18 schrieb Martin Goodson: ...Do people setup pgbouncer nodes on the database servers themselves, on application servers, in the middle tier between the

Re: [GENERAL] Freeing memory in native extension in case of error

2017-06-15 Thread Tom Lane
Gabriel Furstenheim Milerud writes: > I've written an extension in C to sum jsonb. For that I use the > jsonbiterator defined in > https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/jsonb_util.c#L743 > In the comments of JsonbIteratorNext it states:

Re: [GENERAL] Trigger problems/questions

2017-06-15 Thread Adrian Klaver
On 06/15/2017 10:23 AM, Jim Fulton wrote: I have an object database that's mirrored to a table with data in a JSONB column. Data are organized into "communities". Community ids aren't stored directly in content but can be found by recursively following __parent__ properties. I want to be

Re: [GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, Adrian, On Thu, Jun 15, 2017 at 4:13 PM, Adrian Klaver wrote: > On 06/15/2017 12:02 PM, Igor Korot wrote: >> >> Hi, again, >> >> On Thu, Jun 15, 2017 at 2:59 PM, Igor Korot wrote: >>> >>> Hi, ALL, >>> I'm looking at the documentation at >>>

Re: [DOCS] [GENERAL] pg_upgrade --link on Windows

2017-06-15 Thread Bruce Momjian
On Tue, Jun 13, 2017 at 04:07:48PM -0400, Bruce Momjian wrote: > On Fri, Jun 9, 2017 at 07:55:55AM -0700, Adrian Klaver wrote: > I apologize for not being smarter on this thread. When I helped with > the Windows port, I was told Windows didn't have hard links for use by > tablespace directories,

Re: [GENERAL] CREATE FOREIGN TABLE difficulties

2017-06-15 Thread Paul Lavoie
The ‘does not actually create’ the table was the piece I was missing. I wasn’t sure either way from reading the documentation for the command, but makes sense from a perspective of trying to keep the databases independent. One of the reasons I went down this path was the hopes to not need to

Re: [GENERAL] Trigger problems/questions

2017-06-15 Thread Jim Fulton
On Thu, Jun 15, 2017 at 1:56 PM, Tom Lane wrote: > Jim Fulton writes: > > I have an object database that's mirrored to a table with data in a JSONB > > column. Data are organized into "communities". Community ids aren't > > stored directly in content

Re: [GENERAL] Connection options

2017-06-15 Thread Adrian Klaver
On 06/15/2017 12:02 PM, Igor Korot wrote: Hi, again, On Thu, Jun 15, 2017 at 2:59 PM, Igor Korot wrote: Hi, ALL, I'm looking at the documentation at www.postgresql.org/docs/current/static/libpq-connect.html section 32.1.2. The part for "option" reads: [quote] Specifies

Re: [GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, again, On Thu, Jun 15, 2017 at 2:59 PM, Igor Korot wrote: > Hi, ALL, > I'm looking at the documentation at > www.postgresql.org/docs/current/static/libpq-connect.html > section 32.1.2. > > The part for "option" reads: > > [quote] > Specifies command-line options to send

Re: [GENERAL] Index-only scan on GIN index for COUNT() queries

2017-06-15 Thread Alexander Kuzmenkov
On 15.06.2017 17:43, Seamus Abshere wrote: Theoretically, could support be added for Index-only scans on GIN indexes when only a COUNT() is requested? Hi Seamus, I am working on a patch that adds this possibility for GIN and any other indexes that support bitmap scans. You can follow the

Re: [GENERAL] CREATE FOREIGN TABLE difficulties

2017-06-15 Thread Adrian Klaver
On 06/15/2017 09:49 AM, Paul Lavoie wrote: Hi, Long time user, new poster… For assorted reasons I’ve decided to shard a database across multiple instances of postgresql running on the same machine. I’ve set up a lot of children servers with a ‘fdw’ user to work with the foreign data wrapper

Re: [GENERAL] Trigger problems/questions

2017-06-15 Thread Tom Lane
Jim Fulton writes: > I have an object database that's mirrored to a table with data in a JSONB > column. Data are organized into "communities". Community ids aren't > stored directly in content but can be found by recursively following > __parent__ properties. I want to be

Re: [GENERAL] Trigger problems/questions

2017-06-15 Thread Jim Fulton
On Thu, Jun 15, 2017 at 1:44 PM, Adrian Klaver wrote: > On 06/15/2017 10:23 AM, Jim Fulton wrote: > ... > I do not pretend to fully understand what the the triggers/functions are > really doing, but I did notice this: > > create or replace function

[GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, ALL, I'm looking at the documentation at www.postgresql.org/docs/current/static/libpq-connect.html section 32.1.2. The part for "option" reads: [quote] Specifies command-line options to send to the server... [/quote] Does this mean that if I'm writing a C/C++ program, I shouldn't care

[GENERAL] Freeing memory in native extension in case of error

2017-06-15 Thread Gabriel Furstenheim Milerud
Hi, I've written an extension in C to sum jsonb. For that I use the jsonbiterator defined in https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/jsonb_util.c#L743 In the comments of JsonbIteratorNext it states: 'Callers in such a scenario, that are particularly sensitive to

Re: [GENERAL] Freeing memory in native extension in case of error

2017-06-15 Thread Gabriel Furstenheim Milerud
Great, thanks On 15 June 2017 at 22:07, Tom Lane wrote: > Gabriel Furstenheim Milerud writes: >> I've written an extension in C to sum jsonb. For that I use the >> jsonbiterator defined in >>

[GENERAL] Trigger problems/questions

2017-06-15 Thread Jim Fulton
I have an object database that's mirrored to a table with data in a JSONB column. Data are organized into "communities". Community ids aren't stored directly in content but can be found by recursively following __parent__ properties. I want to be able to index content records on their community

Re: [GENERAL] Connection options

2017-06-15 Thread Tom Lane
Igor Korot writes: > On Thu, Jun 15, 2017 at 4:46 PM, David G. Johnston > wrote: >> The options you pass from the client via the "options" attribute are >> interpreted by *the server* as command-line options. They are not options >> that control

Re: [GENERAL] plpgsql function with offset - Postgres 9.1

2017-06-15 Thread David G. Johnston
On Thu, Jun 15, 2017 at 3:19 PM, Patrick B wrote: > 2017-05-29 19:27 GMT+12:00 Albe Laurenz : > >> Patrick B wrote: >> > I am running a background task on my DB, which will copy data from >> tableA to tableB. For >> > that, I'm writing a

Re: [GENERAL] Connection options

2017-06-15 Thread Adrian Klaver
On 06/15/2017 02:41 PM, Igor Korot wrote: Hi, David, On Thu, Jun 15, 2017 at 4:46 PM, David G. Johnston wrote: On Thu, Jun 15, 2017 at 1:23 PM, Igor Korot wrote: And could you clarify on the first part of this? From the quote I poste it

Re: [GENERAL] plpgsql function with offset - Postgres 9.1

2017-06-15 Thread Patrick B
2017-05-29 19:27 GMT+12:00 Albe Laurenz : > Patrick B wrote: > > I am running a background task on my DB, which will copy data from > tableA to tableB. For > > that, I'm writing a PL/PGSQL function which basically needs to do the > following: > > > > > > 1.Select the

Re: [GENERAL] plpgsql function with offset - Postgres 9.1

2017-06-15 Thread David G. Johnston
On Thu, Jun 15, 2017 at 3:49 PM, Patrick B wrote: > 2017-06-16 10:35 GMT+12:00 David G. Johnston : > >> On Thu, Jun 15, 2017 at 3:19 PM, Patrick B >> wrote: >> >>> 2017-05-29 19:27 GMT+12:00 Albe Laurenz

Re: [GENERAL] Connection options

2017-06-15 Thread David G. Johnston
On Thu, Jun 15, 2017 at 1:23 PM, Igor Korot wrote: > And could you clarify on the first part of this? > From the quote I poste it sounds like this is available only in > command-line > tools. And if someone will use it inside the program it will be ignored. > ​The options

Re: [GENERAL] Connection options

2017-06-15 Thread David G. Johnston
On Thu, Jun 15, 2017 at 2:41 PM, Igor Korot wrote: > > On Thu, Jun 15, 2017 at 4:46 PM, David G. Johnston > wrote: > > On Thu, Jun 15, 2017 at 1:23 PM, Igor Korot wrote: > >> > >> And could you clarify on the first part of

Re: [GENERAL] Connection options

2017-06-15 Thread David G. Johnston
On Thu, Jun 15, 2017 at 3:16 PM, Tom Lane wrote: > Igor Korot writes: > > On Thu, Jun 15, 2017 at 4:46 PM, David G. Johnston > > wrote: > >> The options you pass from the client via the "options" attribute are > >> interpreted

Re: [GENERAL] Connection options

2017-06-15 Thread Adrian Klaver
On 06/15/2017 01:23 PM, Igor Korot wrote: Hi, Adrian, On Thu, Jun 15, 2017 at 4:13 PM, Adrian Klaver wrote: On 06/15/2017 12:02 PM, Igor Korot wrote: Hi, again, On Thu, Jun 15, 2017 at 2:59 PM, Igor Korot wrote: Hi, ALL, I'm looking at

Re: [GENERAL] plpgsql function with offset - Postgres 9.1

2017-06-15 Thread Patrick B
2017-06-16 10:35 GMT+12:00 David G. Johnston : > On Thu, Jun 15, 2017 at 3:19 PM, Patrick B > wrote: > >> 2017-05-29 19:27 GMT+12:00 Albe Laurenz : >> >>> Patrick B wrote: >>> > I am running a background task on my

Re: [GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, David, On Thu, Jun 15, 2017 at 4:46 PM, David G. Johnston wrote: > On Thu, Jun 15, 2017 at 1:23 PM, Igor Korot wrote: >> >> And could you clarify on the first part of this? >> From the quote I poste it sounds like this is available only in >>

Re: [GENERAL] plpgsql function with offset - Postgres 9.1

2017-06-15 Thread Peter J. Holzer
On 2017-06-16 10:19:45 +1200, Patrick B wrote: > 2017-05-29 19:27 GMT+12:00 Albe Laurenz : > Patrick B wrote: > > I am running a background task on my DB, which will copy data from > tableA > to tableB. For > > that, I'm writing a PL/PGSQL function which

[GENERAL] Index-only scan on GIN index for COUNT() queries

2017-06-15 Thread Seamus Abshere
hi, We have a GIN index on jsonb_col. We always get Bitmap Index Scan + Bitmap Heap Scan when we do things like SELECT COUNT(*) FROM mytable WHERE jsonb_col ? 'key1' Theoretically, could support be added for Index-only scans on GIN indexes when only a COUNT() is requested? Thanks, Seamus PS.

[GENERAL] CREATE FOREIGN TABLE difficulties

2017-06-15 Thread Paul Lavoie
Hi, Long time user, new poster… For assorted reasons I’ve decided to shard a database across multiple instances of postgresql running on the same machine. I’ve set up a lot of children servers with a ‘fdw’ user to work with the foreign data wrapper and created the child database along with a