Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-10 Thread Andreas Karlsson
On 06/10/2016 01:44 PM, Andreas Karlsson wrote: I have attached a patch which adds the shcema, plus an updated patch for tseach2. Forgot adding schema to the tables. Here are new versions. Andreas parallel-contrib-v4-tsearch2.patch.gz Description: application/gzip diff --git

Re: [HACKERS] [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted

2016-06-10 Thread Amit Kapila
On Thu, Jun 9, 2016 at 11:38 PM, Tom Lane wrote: > > Robert Haas writes: > > > Could you answer my question about whether adjust_appendrel_attrs() > > might translate Vars into non-Vars? > > Yes, absolutely. Isn't this true only for UNION ALL cases and

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-10 Thread Andreas Karlsson
On 06/09/2016 10:48 PM, Tom Lane wrote: Robert Haas writes: On Sat, May 21, 2016 at 11:45 AM, Tom Lane wrote: Yes, let's fix it. This will also take care of the questions about whether the GIN/GIST opclass tweaks I made a few months ago require

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-06-10 Thread Kevin Grittner
On Fri, Jun 10, 2016 at 10:26 AM, Robert Haas wrote: > On Fri, Jun 10, 2016 at 10:45 AM, Kevin Grittner wrote: >> Since vacuum calls the pruning function, and not the other way >> around, the name you suggest would be technically more correct. >>

Re: [HACKERS] Online DW

2016-06-10 Thread David G. Johnston
On Fri, Jun 10, 2016 at 4:11 AM, Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi > > Is there any feature in PostgreSQL where online DW (Dataware housing) is > possible ? > > am looking for scenario like > > 1. Production DB will have CURRENT + LAST 7 DAYS data only > > 2. Archive/DW

Re: [HACKERS] [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted

2016-06-10 Thread Robert Haas
On Thu, Jun 9, 2016 at 8:17 PM, Tom Lane wrote: > I wrote: >> Robert Haas writes: >>> There's one other related thing I'm concerned about, which is that the >>> code in namespace.c that manages pg_temp doesn't know anything about >>> parallelism. So it

Re: [HACKERS] proposal: PL/Pythonu - function ereport

2016-06-10 Thread Pavel Stehule
2016-06-10 20:56 GMT+02:00 Peter Eisentraut < peter.eisentr...@2ndquadrant.com>: > I noticed that this new feature in PL/Python gratuitously uses slightly > different keyword names than the C and PL/pgSQL APIs, e.g. "schema" instead > of "schema_name" etc. I propose to fix that with the attached

Re: [HACKERS] [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted

2016-06-10 Thread Robert Haas
On Fri, Jun 10, 2016 at 10:50 AM, Tom Lane wrote: > Amit Kapila writes: >> On Thu, Jun 9, 2016 at 11:38 PM, Tom Lane wrote: >>> Robert Haas writes: Could you answer my question about whether

Re: [HACKERS] parallel.c is not marked as test covered

2016-06-10 Thread Peter Eisentraut
On 6/7/16 11:43 PM, Noah Misch wrote: I changed this to keep the main message while overwriting the CONTEXT; a bug in this area could very well produce some other error rather than no error. Regarding the patch that ended up being committed, I wonder if it is intentional that PL/pgSQL

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Andres Freund
On 2016-06-09 23:39:24 -0700, Andres Freund wrote: > On 2016-06-10 11:58:26 +0530, Amit Kapila wrote: > > I have tried in multiple ways by running pgbench with read-write tests, but > > could not see any such behaviour. > > It took over an hour of pgbench on a fast laptop till I saw it. > > > >

Re: [HACKERS] parallel workers and client encoding

2016-06-10 Thread Peter Eisentraut
On 6/6/16 9:45 PM, Peter Eisentraut wrote: Attached is a patch to illustrates how this could be fixed. There might be similar issues elsewhere. The notification propagation in particular could be affected. Tracing the code, NotificationResponse messages are converted to the client encoding

Re: [HACKERS] proposal: PL/Pythonu - function ereport

2016-06-10 Thread Peter Eisentraut
I noticed that this new feature in PL/Python gratuitously uses slightly different keyword names than the C and PL/pgSQL APIs, e.g. "schema" instead of "schema_name" etc. I propose to fix that with the attached patch. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL

Re: [HACKERS] parallel.c is not marked as test covered

2016-06-10 Thread Robert Haas
On Fri, Jun 10, 2016 at 1:49 PM, Peter Eisentraut wrote: > Regarding the patch that ended up being committed, I wonder if it is > intentional that PL/pgSQL overwrites the context from the parallel worker. > Shouldn't the context effectively look like > > ERROR:

Re: [HACKERS] [sqlsmith] Failed assertion in postgres_fdw/deparse.c:1116

2016-06-10 Thread Robert Haas
On Wed, Jun 8, 2016 at 8:27 AM, Robert Haas wrote: > On Tue, Jun 7, 2016 at 10:41 PM, Noah Misch wrote: >> [Action required within 72 hours. This is a generic notification.] >> >> The above-described topic is currently a PostgreSQL 9.6 open item.

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Robert Haas
On Fri, Jun 10, 2016 at 1:59 PM, Andres Freund wrote: >> Master, but with an existing standby. So it could be related to >> hot_standby_feedback or such. > > I just managed to trigger it again. > > > #1 0x7fa1a73778da in __GI_abort () at abort.c:89 > #2

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Alvaro Herrera
Robert Haas wrote: > 3. vacuumlazy.c includes this code: > > if (heap_prepare_freeze_tuple(tuple.t_data, FreezeLimit, > MultiXactCutoff, [nfrozen])) > frozen[nfrozen++].offset = offnum; > else if

Re: [HACKERS] Prepared statements and generic plans

2016-06-10 Thread 'br...@momjian.us'
On Tue, Jun 7, 2016 at 06:52:15AM +, Albe Laurenz wrote: > Bruce Momjian wrote: > >> !distinct column values, a generic plan assumes a column equality > >> !comparison will match 33% of processed rows. Column statistics > >> > >> ... assumes *that* a column equality comparison will

[HACKERS] Confusing recovery message when target not hit

2016-06-10 Thread Thom Brown
Hi all, When recovery_target_time is set, but recovery finishes before it reaches that time, it outputs "before 2000-01-01 00:00:00+00" to the .history file. This is because it uses recoveryStopTime, which is initialised to 0, but is never set, and is then passed to timestamptz_to_str, which

Re: [HACKERS] Perf Benchmarking and regression.

2016-06-10 Thread Andres Freund
On 2016-06-09 17:19:34 -0700, Andres Freund wrote: > On 2016-06-09 14:37:31 -0700, Andres Freund wrote: > > I'm writing a patch right now, planning to post it later today, commit > > it tomorrow. > > Attached. And pushed. Thanks to Michael for noticing the missing addition of header file hunk.

Re: [HACKERS] [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted

2016-06-10 Thread Amit Kapila
On Fri, Jun 10, 2016 at 8:20 PM, Tom Lane wrote: > > Amit Kapila writes: > > On Thu, Jun 9, 2016 at 11:38 PM, Tom Lane wrote: > >> Robert Haas writes: > >>> Could you answer my question about whether

Re: [HACKERS] Online DW

2016-06-10 Thread Sridhar N Bamandlapally
Ok, let me put this way, I need every transaction coming from application sync with both production and archive db, but the transactions I do to clean old data(before 7 days) on production db in daily maintenance window should not sync with archive db, Archive db need read-only, used for

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Amit Kapila
On Thu, Jun 9, 2016 at 9:41 PM, Robert Haas wrote: > > > > 2. The all-visible checks seemed to me to be incorrect and incomplete. > I made the check match the logic in lazy_scan_heap. > Okay, I thought we just want to check for dead-tuples. If we want the logic similar to

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Amit Kapila
On Fri, Jun 10, 2016 at 8:27 AM, Andres Freund wrote: > > > On June 9, 2016 7:46:06 PM PDT, Amit Kapila > wrote: > >On Fri, Jun 10, 2016 at 8:08 AM, Andres Freund > >wrote: > > > >> On 2016-06-09 19:33:52 -0700, Andres Freund

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Andres Freund
On 2016-06-10 11:58:26 +0530, Amit Kapila wrote: > I have tried in multiple ways by running pgbench with read-write tests, but > could not see any such behaviour. It took over an hour of pgbench on a fast laptop till I saw it. > I have tried by even crashing and > restarting the server and then

[HACKERS] Re: Should phraseto_tsquery('simple', 'blue blue') @@ to_tsvector('simple', 'blue') be true ?

2016-06-10 Thread Noah Misch
On Tue, Jun 07, 2016 at 06:05:10PM -0400, Tom Lane wrote: > Jean-Pierre Pelletier writes: > > I wanted to test if phraseto_tsquery(), new with 9.6 could be used for > > matching consecutive words but it won't work for us if it cannot handle > > consecutive *duplicate*

Re: [HACKERS] [BUG] pg_basebackup from disconnected standby fails

2016-06-10 Thread Michael Paquier
On Thu, Jun 9, 2016 at 9:55 PM, Kyotaro HORIGUCHI wrote: > Hello, I found that pg_basebackup from a replication standby > fails after the following steps, on 9.3 and the master. > > - start a replication master > - start a replication standby > - stop the master

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Masahiko Sawada
On Fri, Jun 10, 2016 at 1:11 AM, Robert Haas wrote: > On Thu, Jun 9, 2016 at 5:48 AM, Amit Kapila wrote: >> Attached patch implements the above 2 functions. I have addressed the >> comments by Sawada San and you in latest patch and updated the

Re: [HACKERS] Online DW

2016-06-10 Thread Craig Ringer
On 10 June 2016 at 16:11, Sridhar N Bamandlapally wrote: > Hi > > Is there any feature in PostgreSQL where online DW (Dataware housing) is > possible ? > > am looking for scenario like > > 1. Production DB will have CURRENT + LAST 7 DAYS data only > > 2. Archive/DW DB will

Re: [HACKERS] [sqlsmith] Failed assertion in postgres_fdw/deparse.c:1116

2016-06-10 Thread Amit Langote
On 2016/06/10 2:07, Robert Haas wrote: > On Thu, Jun 9, 2016 at 5:50 AM, Amit Langote wrote: >> I adjusted some comments per off-list suggestion from Ashutosh. Please >> find attached the new version. > > Are PlaceHolderVars the only problem we need to worry about here? It seems so, as far as

Re: [HACKERS] Online DW

2016-06-10 Thread Sridhar N Bamandlapally
One thing looks possible ( feature not available), just an idea example/syntax: BEGIN NOARCHIVE; --- transaction-1 --- transaction-2 . . --- transaction-N END; This/These will be performed in Production to clean-up archive which will not be sync with Archive/DW DB only one heads-up

[HACKERS] Online DW

2016-06-10 Thread Sridhar N Bamandlapally
Hi Is there any feature in PostgreSQL where online DW (Dataware housing) is possible ? am looking for scenario like 1. Production DB will have CURRENT + LAST 7 DAYS data only 2. Archive/DW DB will have CURRENT + COMPLETE HISTORY expecting something like streaming, but not ETL Thanks Sridhar

Re: [HACKERS] Reviewing freeze map code

2016-06-10 Thread Amit Kapila
On Fri, Jun 10, 2016 at 12:09 PM, Andres Freund wrote: > > On 2016-06-10 11:58:26 +0530, Amit Kapila wrote: > > > > While looking at code in this area, I observed that during replay of > > records (heap_xlog_delete), we first clear the vm, then update the page. > > So we don't

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-06-10 Thread Robert Haas
On Fri, Jun 10, 2016 at 10:45 AM, Kevin Grittner wrote: > On Thu, Jun 9, 2016 at 6:16 PM, Robert Haas wrote: > >> So I like the idea of centralizing checks in >> RelationAllowsEarlyVacuum, but shouldn't it really be called >> RelationAllowsEarlyPruning?

Re: [HACKERS] Hard to maintain duplication in contain_volatile_functions_not_nextval_walker

2016-06-10 Thread Tom Lane
Andres Freund writes: > contain_volatile_functions_walker is duplicated, near entirely, in > contain_volatile_functions_not_nextval_walker. > Wouldn't it have been better not to duplicate, and keep a flag about > ignoring nextval in the context variable? > While at it,

Re: [HACKERS] Hard to maintain duplication in contain_volatile_functions_not_nextval_walker

2016-06-10 Thread Robert Haas
On Fri, Jun 10, 2016 at 11:12 AM, Tom Lane wrote: > Andres Freund writes: >> contain_volatile_functions_walker is duplicated, near entirely, in >> contain_volatile_functions_not_nextval_walker. >> Wouldn't it have been better not to duplicate, and keep a

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-06-10 Thread Kevin Grittner
On Thu, Jun 9, 2016 at 6:16 PM, Robert Haas wrote: > So I like the idea of centralizing checks in > RelationAllowsEarlyVacuum, but shouldn't it really be called > RelationAllowsEarlyPruning? Since vacuum calls the pruning function, and not the other way around, the name

Re: [HACKERS] [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted

2016-06-10 Thread Tom Lane
Amit Kapila writes: > On Thu, Jun 9, 2016 at 11:38 PM, Tom Lane wrote: >> Robert Haas writes: >>> Could you answer my question about whether adjust_appendrel_attrs() >>> might translate Vars into non-Vars? >> Yes, absolutely.