Re: [GENERAL] [HACKERS] pgjdbc logical replication client throwing exception

2017-09-15 Thread Dipesh Dangol
Hi Vladimir, Ya, initially I was trying with withStatusInterval(20, TimeUnit.SECONDS), that didn't work so, then only I switched to .withStatusInterval(20, TimeUnit.MILLISECONDS) but it is not working as well. I am not aware of type of test cases that you are pointing. Could you please send me

Re: [GENERAL] New interface to PG from Chapel?

2017-09-15 Thread Steve Atkins
> On Sep 15, 2017, at 12:56 PM, Thelonius Buddha wrote: > > I’m interested to know the level of effort to build a psycopg2-like library > for Chapel: http://chapel.cray.com/ Not being much of a programmer myself, > does someone have an educated opinion on this? It looks

Re: [GENERAL] New interface to PG from Chapel?

2017-09-15 Thread John R Pierce
On 9/15/2017 12:56 PM, Thelonius Buddha wrote: I’m interested to know the level of effort to build a psycopg2-like library for Chapel: http://chapel.cray.com/ Not being much of a programmer myself, does someone have an educated opinion on this? I don't see any standard database interface

Re: [GENERAL] [HACKERS] pgjdbc logical replication client throwing exception

2017-09-15 Thread Andres Freund
On 2017-09-15 20:00:34 +, Vladimir Sitnikov wrote: > ++pgjdbc dev list. > > >I am facing unusual connection breakdown problem. Here is the simple code > that I am using to read WAL file: > > Does it always fails? > Can you create a test case? For instance, if you file a pull request with >

Re: [GENERAL] [HACKERS] pgjdbc logical replication client throwing exception

2017-09-15 Thread Vladimir Sitnikov
++pgjdbc dev list. >I am facing unusual connection breakdown problem. Here is the simple code that I am using to read WAL file: Does it always fails? Can you create a test case? For instance, if you file a pull request with the test, it will get automatically tested across various PG versions,

[GENERAL] New interface to PG from Chapel?

2017-09-15 Thread Thelonius Buddha
I’m interested to know the level of effort to build a psycopg2-like library for Chapel: http://chapel.cray.com/ Not being much of a programmer myself, does someone have an educated opinion on this? Thank you, b

Re: [GENERAL] cursor declare

2017-09-15 Thread Tom Lane
Peter Koukoulis writes: > This is my first cursor attempt: > according to docs > DECLARE > curs1 refcursor; > curs2 CURSOR FOR SELECT * FROM tenk1; > curs3 CURSOR (key integer) FOR SELECT * FROM tenk1 WHERE unique1 = key; > this should work, but getting error:

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Rafal Pietrak
W dniu 15.09.2017 o 20:49, Rob Sargent pisze: > > > On 09/15/2017 12:45 PM, Adam Brusselback wrote: >> >> I cannot image a single postgres index covering more than one >> physical table. Are you really asking for that? >> >> >> While not available yet, that is a feature that has had

[GENERAL] cursor declare

2017-09-15 Thread Peter Koukoulis
Hi This is my first cursor attempt: according to docs DECLARE curs1 refcursor; curs2 CURSOR FOR SELECT * FROM tenk1; curs3 CURSOR (key integer) FOR SELECT * FROM tenk1 WHERE unique1 = key; this should work, but getting error: ft_node=# declare cur_test1 CURSOR (key integer) for

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Christopher Browne
On 15 September 2017 at 14:45, Adam Brusselback wrote: >> I cannot image a single postgres index covering more than one physical >> table. Are you really asking for that? > > > While not available yet, that is a feature that has had discussion before. > Global indexes

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Rob Sargent
On 09/15/2017 12:45 PM, Adam Brusselback wrote: I cannot image a single postgres index covering more than one physical table. Are you really asking for that? While not available yet, that is a feature that has had discussion before. Global indexes are what i've seen it called in

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Adam Brusselback
> > I cannot image a single postgres index covering more than one physical > table. Are you really asking for that? While not available yet, that is a feature that has had discussion before. Global indexes are what i've seen it called in those discussions. One of the main use cases is to

[GENERAL] pgjdbc logical replication client throwing exception

2017-09-15 Thread Dipesh Dangol
hi, I am trying to implement logical replication stream API of postgresql. I am facing unusual connection breakdown problem. Here is the simple code that I am using to read WAL file: String url = "jdbc:postgresql://pcnode2:5432/benchmarksql"; Properties props = new Properties();

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Rob Sargent
Isn't this typically handled with an inheritance (parent-children) setup. MasterDocument has id, subtype and any common columns (create date etc) then dependents use the same id from master to complete the data for a given type. This is really common in ORM tools. Not clear from the

Re: [GENERAL] Performance with high correlation in group by on PK

2017-09-15 Thread Alban Hertroys
On 8 September 2017 at 00:23, Jeff Janes wrote: > On Tue, Aug 29, 2017 at 1:20 AM, Alban Hertroys wrote: >> >> On 28 August 2017 at 21:32, Jeff Janes wrote: >> > On Mon, Aug 28, 2017 at 5:22 AM, Alban Hertroys

Re: [GENERAL] Table partition - parent table use

2017-09-15 Thread Francisco Olarte
Luiz: 1st thing, do not top-quote. It's hard to read and I, personally, consider it insulting ( not the first time it's done, and for obvious reasons ). On Fri, Sep 15, 2017 at 4:24 PM, Luiz Hugo Ronqui wrote: > Our usage allows us to insert all rows into the hot

RES: [GENERAL] Table partition - parent table use

2017-09-15 Thread Luiz Hugo Ronqui
Thanks for your tips! Our usage allows us to insert all rows into the hot partition, since its a rare event to receive data that otherwise would have to be redirected to a "colder" partition. This way, its not a problem that the parent table would always be searched. In fact it would

[GENERAL] 10 beta 4 foreign table partition check constraint broken?

2017-09-15 Thread Paul Jones
Is this a bug in Postgres 10b4? Looks like neither partition ranges nor check constraints are honored in 10b4 when inserting into partitions that are foreign tables. Here is a nearly shovel-ready example. Just replace with your servers/passwords. -- -- -- Server 1 --

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Rafal Pietrak
W dniu 15.09.2017 o 13:36, Alban Hertroys pisze: > On 15 September 2017 at 11:03, Rafal Pietrak wrote: > [-] > > For example, if we define: > create table master_table ( > year int > , month int > , example text > , primary key (year, month) > ); >

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Kenneth Marshall
> > > Hmm... > > 2 4 6 8 10 > > 3 6 > > 5 10 > > Adding a prime as an increment is not sufficient to guarantee uniqueness! > > You have to ensure that the product of the 2 smallest primes you use > is greater than any number you'd need to generate.  With such large > primes you may run out of

Re: [GENERAL] "Canceling authentication due to timeout" with idle transaction and reindex

2017-09-15 Thread Justin Pryzby
On Fri, Sep 15, 2017 at 06:49:06AM -0500, Ron Johnson wrote: > On 09/15/2017 06:34 AM, Justin Pryzby wrote: > [snip] > >But you might consider: 1) looping around tables/indices rather than "REINDEX > >DATABASE", and then setting a statement_timeout=9s for each REINDEX > >statement; > > Is there

Re: [GENERAL] "Canceling authentication due to timeout" with idle transaction and reindex

2017-09-15 Thread Ron Johnson
On 09/15/2017 06:34 AM, Justin Pryzby wrote: [snip] But you might consider: 1) looping around tables/indices rather than "REINDEX DATABASE", and then setting a statement_timeout=9s for each REINDEX statement; Is there a way to do that within psql? (Doing it from bash is trivial, but I'd

Re: [GENERAL] Table partition - parent table use

2017-09-15 Thread Francisco Olarte
Hi Luiz: On Thu, Sep 14, 2017 at 11:06 PM, Luiz Hugo Ronqui wrote: ... > We have a database with data being inserted for almost 10 years and no > policy defined to get rid of old records, even though we mostly use only the > current and last year's data. Some etl processes

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Alban Hertroys
On 15 September 2017 at 11:03, Rafal Pietrak wrote: >> Isn't this typically handled with an inheritance (parent-children) >> setup. MasterDocument has id, subtype and any common columns (create >> date etc) then dependents use the same id from master to complete the >> data for

Re: [GENERAL] "Canceling authentication due to timeout" with idle transaction and reindex

2017-09-15 Thread Justin Pryzby
On Fri, Sep 15, 2017 at 12:25:58PM +0200, s19n wrote: > 1. with "\set AUTOCOMMIT off" in my psqlrc, issue a > "SELECT * FROM pg_stat_activity;" and leave it there This probably obtains a read lock on some shared, system tables/indices.. > 2. in a different connection, issue a database REINDEX

Re: [GENERAL] "Canceling authentication due to timeout" with idle transaction and reindex

2017-09-15 Thread Michael Paquier
On Fri, Sep 15, 2017 at 7:25 PM, s19n wrote: > Is this expected? I am failing to see the relation between an idle > transaction in the 'postgres' database, a reindex operation and subsequent > logins. REINDEX DATABASE processes as well system indexes, and takes an exclusive

[GENERAL] "Canceling authentication due to timeout" with idle transaction and reindex

2017-09-15 Thread s19n
Hello, I am experiencing the following while using PostgreSQL 9.6.3-1.pgdg16.04+1 (deb package from official repository): 1. with "\set AUTOCOMMIT off" in my psqlrc, issue a "SELECT * FROM pg_stat_activity;" and leave it there 2. in a different connection, issue a database REINDEX (of any

Re: [GENERAL] looking for a globally unique row ID

2017-09-15 Thread Rafal Pietrak
W dniu 14.09.2017 o 23:15, Rob Sargent pisze: > > > On 09/14/2017 02:39 PM, Rafal Pietrak wrote: >> >> W dniu 14.09.2017 o 19:30, Rob Sargent pisze: >>> >>> On 09/14/2017 11:11 AM, Rafal Pietrak wrote: [--] >> >> Throwing actual numbers: 12 basic classes of documents; 17

Re: [GENERAL] pg_rewind copy so much data

2017-09-15 Thread Michael Paquier
On Fri, Sep 15, 2017 at 2:57 PM, Hung Phan wrote: > [...] Please do not top-post. This breaks the logic of the thread. > I use ver 9.5.3. You should update to the latest minor version available, there have been quite a couple of bug fixes in Postgres since this 9.5.3. >

Re: [GENERAL] pg_rewind copy so much data

2017-09-15 Thread Hung Phan
I use ver 9.5.3. I have just run again and get the debug log. It seems to be that I cannot send such big file to postgresql mail so I copy some parts here: fetched file "global/pg_control", length 8192 fetched file "pg_xlog/000D.history", length 475 servers diverged at WAL position 2/D69820C8