Re: [HACKERS] Parallel bitmap heap scan

2017-03-27 Thread Rafia Sabih
On Wed, Mar 8, 2017 at 11:52 PM, Robert Haas wrote: > On Wed, Mar 8, 2017 at 1:18 PM, Tom Lane wrote: >> Robert Haas writes: >>> What I'm using is: >> >>> Configured with: >>> --prefix=/Applications/Xcode.app/Contents/Developer/usr >>> --with-gxx-include-dir=/usr/include/c++/4.2.1 >>> Apple LLVM

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-03-27 Thread Michael Paquier
On Sat, Mar 25, 2017 at 9:50 PM, Craig Ringer wrote: > I'm fairly confident that I overlooked single row mode entirely in the > original patch, though it's long enough ago that it's hard for me to > remember exactly. > > I don't really have much of an opinion on the best handling of it. > > I woul

Re: [HACKERS] UPDATE of partition key

2017-03-27 Thread Amit Khandekar
On 25 March 2017 at 01:34, Amit Khandekar wrote: I am yet to handle all of your comments, but meanwhile , attached is > an updated patch, that handles RETURNING. > > Earlier it was not working because ExecInsert() did not return any > RETURNING clause. This is because the setup needed to create RE

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-03-27 Thread Craig Ringer
On 27 March 2017 at 15:26, Michael Paquier wrote: > On Sat, Mar 25, 2017 at 9:50 PM, Craig Ringer wrote: >> I'm fairly confident that I overlooked single row mode entirely in the >> original patch, though it's long enough ago that it's hard for me to >> remember exactly. >> >> I don't really have

Re: [HACKERS] free space map and visibility map

2017-03-27 Thread Masahiko Sawada
On Mon, Mar 27, 2017 at 2:38 PM, Kyotaro HORIGUCHI wrote: > At Sat, 25 Mar 2017 19:53:47 -0700, Jeff Janes wrote > in >> On Thu, Mar 23, 2017 at 7:01 PM, Kyotaro HORIGUCHI < >> horiguchi.kyot...@lab.ntt.co.jp> wrote: >> >> > At Wed, 22 Mar 2017 02:15:26 +0900, Masahiko Sawada >> > wrote in > >

Re: [HACKERS] Monitoring roles patch

2017-03-27 Thread Simon Riggs
On 25 March 2017 at 16:30, Dave Page wrote: > I believe this and other reasons we've described are exactly why other DBMS' > do what we're proposing. It would help review if you could show some links and give a commentary on what you think others do, what they get right and what they get wrong,

Re: [HACKERS] Logical decoding on standby

2017-03-27 Thread Craig Ringer
On 27 March 2017 at 14:08, Craig Ringer wrote: > So this patch makes ReplicationSlotAcquire check that the slot > database matches the current database and refuse to acquire the slot > if it does not. New patch attached that drops above requirement, so slots can still be dropped from any DB. Th

Re: [HACKERS] increasing the default WAL segment size

2017-03-27 Thread Simon Riggs
On 25 March 2017 at 17:02, Peter Eisentraut wrote: > At this point, I suggest splitting this patch up into several > potentially less controversial pieces. > > One big piece is that we currently don't support segment sizes larger > than 64 GB, for various internal arithmetic reasons. Your patch a

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-03-27 Thread Michael Paquier
On Mon, Mar 27, 2017 at 4:42 PM, Craig Ringer wrote: > On 27 March 2017 at 15:26, Michael Paquier wrote: >> On Sat, Mar 25, 2017 at 9:50 PM, Craig Ringer wrote: >>> I'm fairly confident that I overlooked single row mode entirely in the >>> original patch, though it's long enough ago that it's ha

Re: [HACKERS] Logical decoding on standby

2017-03-27 Thread Simon Riggs
On 27 March 2017 at 09:03, Craig Ringer wrote: > I think this one's ready to go. Looks like something I could commit. Full review by me while offline today, aiming to commit tomorrow barring issues raised. -- Simon Riggshttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 S

Re: [HACKERS] Proposal for changes to recovery.conf API

2017-03-27 Thread Simon Riggs
On 7 March 2017 at 23:31, Josh Berkus wrote: > On 03/02/2017 07:13 AM, David Steele wrote: >> Hi Simon, >> >> On 2/25/17 2:43 PM, Simon Riggs wrote: >>> On 25 February 2017 at 13:58, Michael Paquier >>> wrote: >>> - trigger_file is removed. FWIW, my only complain is about the removal o

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2017-03-27 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Michael Paquier > Moved to CF 2017-03. Both patches still apply. Sorry to be late for reviewing this, but done now. The patch applied, make check passed, and the code looks almost good. I could s

[HACKERS] Column widening without outage

2017-03-27 Thread Aniruddha Deshpande
Hi All, We want to extend/widen the column without outage. But as column widening takes ACCESS EXCLUSIVE LOCK, we have seen noticeable pause on SELECT/INSERTS. This behavior was more noticeable in tables which has composite Foreign keys. .We tried doing it like below which resulted in minimizing

Re: [HACKERS] New CORRESPONDING clause design

2017-03-27 Thread Pavel Stehule
Hi fresh update - I enhanced Value node by location field as Tom proposal. Few more regress tests. But I found significant issue, that needs bigger fix - Surafel, please, can you fix it. It crash on SELECT 0 AS x1, 1 AS a, 0 AS x2, 2 AS b, 0 AS x3, -1 AS x3 UNION ALL CORRESPONDING SELECT 4 AS

Re: [HACKERS] Parallel bitmap heap scan

2017-03-27 Thread Dilip Kumar
On Mon, Mar 27, 2017 at 12:53 PM, Rafia Sabih wrote: > Recently, on testing TPC-H 300 scale factor I stumbled on to a error > for Q6, the test environment is as follows, > work_mem = 1GB, > shared_buffers = 10 GB, > Effective_cache_size = 10GB > random_page_cost = seq+page_cost =0.1 > > The error

Re: [HACKERS] exposing wait events for non-backends (was: Tracking wait event for latches)

2017-03-27 Thread Kuntal Ghosh
Thank you Robert for committing the patch. commit fc70a4b0df38bda6a13941f1581f25fbb643c7f3 I've changed the status to Committed. On Mon, Mar 27, 2017 at 6:09 AM, Michael Paquier wrote: > On Sat, Mar 25, 2017 at 5:26 PM, Kuntal Ghosh > wrote: >> On Fri, Mar 24, 2017 at 9:23 PM, Robert Haas wro

Re: [HACKERS] logical decoding of two-phase transactions

2017-03-27 Thread Craig Ringer
On 27 March 2017 at 09:31, Craig Ringer wrote: > We're in the last week of the CF. If you have a patch that's nearly > ready or getting there, now would be a good time to post it for help > and input from others. > > I would really like to get this in, but we're running out of time. > > Even if y

Re: [HACKERS] Adding the optional clause 'AS' in CREATE TRIGGER

2017-03-27 Thread Okano, Naoki
Hi Surafel, Thank you for your review! But I have not finish fixing a patch yet. > v Use tage in documentation ok. > v Don’t modified existing test case add new one instead These existing tests I modified are the results of commands "SELECT pg_get_triggerdef(oid, true) ... ". I modified them

Re: [HACKERS] [sqlsmith] Failed assertion in _hash_kill_items/MarkBufferDirtyHint

2017-03-27 Thread Ashutosh Sharma
Hi, > testing with master as of cf366e97ff, sqlsmith occasionally triggers the > following assertion: > > TRAP: FailedAssertion("!(LWLockHeldByMe(((LWLock*) > (&(bufHdr)->content_lock", File: "bufmgr.c", Line: 3397) > > Backtraces always look like the one below. It is reproducible on a > clu

Re: [HACKERS] logical decoding of two-phase transactions

2017-03-27 Thread Stas Kelvich
> On 27 Mar 2017, at 12:26, Craig Ringer wrote: > > On 27 March 2017 at 09:31, Craig Ringer wrote: > >> We're in the last week of the CF. If you have a patch that's nearly >> ready or getting there, now would be a good time to post it for help >> and input from others. >> >> I would really li

Re: [HACKERS] Radix tree for character conversion

2017-03-27 Thread Kyotaro HORIGUCHI
Hmm, things are bit different. At Thu, 23 Mar 2017 12:13:07 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20170323.121307.241436413.horiguchi.kyot...@lab.ntt.co.jp> > > Ok, I'll write a small script to generate a set of "conversion > > dump" and try to write README.sanity_check descr

Re: [HACKERS] pgbench - allow to store select results into variables

2017-03-27 Thread Rafia Sabih
On Fri, Mar 24, 2017 at 8:59 PM, Fabien COELHO wrote: > > Hello Rafia, > >> if (my_command->argc > 2) >> + syntax_error(source, lineno, my_command->line, my_command->argv[0], >> + "at most on argument expected", NULL, -1); >> >> I suppose you mean 'one' argument here. > > > Indeed. > >> Apart from

[HACKERS] example for xmltable with XMLNAMESPACES

2017-03-27 Thread Arjen Nienhuis
It wasn't completely clear for me how to use namespaces in xmltable(). Maybe add this to the documentation. It shows the default namespace and quoting the namespace name. WITH xmldata(data) AS (VALUES (' http://example.com/myns"; xmlns:B="http://example.com/b";> '::xml) ) SELECT xmltable.*

Re: [HACKERS] [POC] A better way to expand hash indexes.

2017-03-27 Thread Amit Kapila
On Mon, Mar 27, 2017 at 11:21 AM, Amit Kapila wrote: > On Sun, Mar 26, 2017 at 11:26 AM, Mithun Cy > wrote: >> Thanks, Amit for the review. >> On Sat, Mar 25, 2017 at 7:03 PM, Amit Kapila wrote: >>> >>> I think one-dimensional patch has fewer places to touch, so that looks >>> better to me. Ho

Re: [HACKERS] Adding support for Default partition in partitioning

2017-03-27 Thread Jeevan Ladhe
Hi Rahila, IIUC, your default_partition_v3.patch is trying to implement an error if new partition is added to a table already having a default partition. I too tried to run the test and similar to Rushabh, I see the server is crashing with the given test. However, if I reverse the order of creat

Re: [HACKERS] Monitoring roles patch

2017-03-27 Thread Simon Riggs
On 23 March 2017 at 13:16, Dave Page wrote: > Thanks - updated patch attached. No problems with the patch so far. I'd like some tests though... -- Simon Riggshttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-03-27 Thread Amit Kapila
On Sat, Mar 25, 2017 at 1:24 PM, Amit Kapila wrote: > On Fri, Mar 24, 2017 at 11:49 PM, Pavan Deolasee > wrote: >> >> On Fri, Mar 24, 2017 at 6:46 PM, Amit Kapila >> wrote: >>> > >> While looking at this problem, it occurred to me that the assumptions made >> for hash indexes are also wrong :-(

Re: [HACKERS] Index usage for elem-contained-by-const-range clauses

2017-03-27 Thread Alexander Korotkov
On Sat, Mar 18, 2017 at 12:41 AM, Pritam Baral wrote: > On Friday 10 March 2017 07:59 PM, Alexander Korotkov wrote: > >> Hi, Pritam! > > I've assigned to review this patch. > > On Thu, Feb 23, >> 2017 at 2:17 AM, Pritam Baral wrote: > > >> The topic has been previously discussed[0] on the -per

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Rushabh Lathia
On Mon, Mar 27, 2017 at 10:59 AM, Rushabh Lathia wrote: > > > On Mon, Mar 27, 2017 at 3:43 AM, Tomas Vondra < > tomas.von...@2ndquadrant.com> wrote: > >> On 03/25/2017 05:18 PM, Rushabh Lathia wrote: >> >>> >>> >>> On Sat, Mar 25, 2017 at 7:01 PM, Peter Eisentraut >>> >>

[HACKERS] On How To Shorten The Steep Learning Curve Towards PG Hacking

2017-03-27 Thread Kang Yuzhe
Dear PG Hacker/Experts, I am newbie to PG Hacking. I have been reading the PG code base to find my space in it but without success. There are hundreds of Hands-on with PG Application development on the web. Alas, there is almost none in PG hacking. I have found PG source Code reading and hackin

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 1:29 AM, Rushabh Lathia wrote: > >> But it seems a bit futile to produce the parallel plan in the first place, >> because with max_parallel_workers=0 we can't possibly get any parallel >> workers ever. I wonder why compute_parallel_worker() only looks at >> max_parallel_wor

Re: [HACKERS] Re: proposal - psql: possibility to specify sort for describe commands, when size is printed

2017-03-27 Thread Alexander Korotkov
On Fri, Mar 10, 2017 at 6:06 PM, Pavel Stehule wrote: > 2017-03-10 16:00 GMT+01:00 Alexander Korotkov : > >> On Fri, Mar 10, 2017 at 5:16 PM, Stephen Frost >> wrote: >> >>> * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: >>> > On 2/24/17 16:32, Pavel Stehule wrote: >>> > > set E

[HACKERS] On How To Shorten the Steep Learning Curve Towards PG Hacking...

2017-03-27 Thread Kang Yuzhe
Dear PG Hackers/Experts, I am newbie to PG Hacking. I have been reading the PG code base to find my space in it but without success. There are hundreds of Hands-on with PG Application development on the web. Alas, there is almost none in PG hacking. I have found PG source Code reading and hackin

Re: [HACKERS] [COMMITTERS] pgsql: Improve access to parallel query from procedural languages.

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 1:48 AM, Rafia Sabih wrote: > This is caused because trigger related functions are marked safe and > using global variables, hence when executed in parallel are giving > incorrect output. Attached patch fixes this. I have modified only > those functions that are showing in

Re: [HACKERS] Parallel bitmap heap scan

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 5:02 AM, Dilip Kumar wrote: > On Mon, Mar 27, 2017 at 12:53 PM, Rafia Sabih > wrote: >> Recently, on testing TPC-H 300 scale factor I stumbled on to a error >> for Q6, the test environment is as follows, >> work_mem = 1GB, >> shared_buffers = 10 GB, >> Effective_cache_size

Re: [HACKERS] perlcritic

2017-03-27 Thread Peter Eisentraut
On 3/1/17 11:21, Dagfinn Ilmari Mannsåker wrote: > diff --git a/src/pl/plperl/plc_perlboot.pl b/src/pl/plperl/plc_perlboot.pl > index 292c9101c9..b4212f5ab2 100644 > --- a/src/pl/plperl/plc_perlboot.pl > +++ b/src/pl/plperl/plc_perlboot.pl > @@ -81,18 +81,15 @@ sub ::encode_array_constructor >

Re: [HACKERS] perlcritic

2017-03-27 Thread Peter Eisentraut
On 3/23/17 11:58, Daniel Gustafsson wrote: > Given the nitpick nature of the comments, bumping status to ready for > committer. Committed, with your changes. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- S

Re: [HACKERS] On How To Shorten the Steep Learning Curve Towards PG Hacking...

2017-03-27 Thread Michael Paquier
On Mon, Mar 27, 2017 at 9:00 PM, Kang Yuzhe wrote: > 1. Prepare Hands-on with PG internals > > For example, a complete Hands-on with SELECT/INSERT SQL Standard PG > internals. The point is the experts can pick one fairly complex feature and > walk it from Parser to Executor in a hands-on manner

Re: [HACKERS] patch proposal

2017-03-27 Thread David Steele
On 3/26/17 7:34 PM, Venkata B Nagothi wrote: > Hi David, > > On Thu, Mar 23, 2017 at 4:21 AM, David Steele > wrote: > > On 3/21/17 8:45 PM, Venkata B Nagothi wrote: > > On Tue, Mar 21, 2017 at 8:46 AM, David Steele > mailto:da...@pgmasters.net> >

Re: [HACKERS] Monitoring roles patch

2017-03-27 Thread Dave Page
On Mon, Mar 27, 2017 at 3:51 AM, Simon Riggs wrote: > On 25 March 2017 at 16:30, Dave Page wrote: > >> I believe this and other reasons we've described are exactly why other DBMS' >> do what we're proposing. > > It would help review if you could show some links and give a > commentary on what yo

[HACKERS] Shorten PG Hacking Steep Learning Curve....

2017-03-27 Thread Kang Yuzhe
Thanks Michael for your informative reply. And thanks for be being patient with my some typos/duplication in the message I sent to pg-hackers mailing list. Regards, Zeray

Re: [HACKERS] Monitoring roles patch

2017-03-27 Thread Robert Haas
On Sat, Mar 25, 2017 at 12:30 PM, Dave Page wrote: > Right - and if a user doesn't like it, they can easily just not use the > default role and create their own alternative instead. OK, I see the points that both of you are making and I admit that they've got some validity to them. Let me make

Re: [HACKERS] Parallel bitmap heap scan

2017-03-27 Thread Dilip Kumar
On Mon, Mar 27, 2017 at 5:58 PM, Robert Haas wrote: > Failing to pass DSA_ALLOC_HUGE is an obvious oversight, but I think > the ptbase == NULL check shouldn't be needed, because we're not > passing DSA_ALLOC_NO_OOM. And that's good, because this is going to > be called from SH_CREATE, which isn't

Re: [HACKERS] [COMMITTERS] pgsql: Improve access to parallel query from procedural languages.

2017-03-27 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 27, 2017 at 1:48 AM, Rafia Sabih > wrote: >> This is caused because trigger related functions are marked safe and >> using global variables, hence when executed in parallel are giving >> incorrect output. > If it's just that they are relying on unsynchronized g

Re: [HACKERS] logical decoding of two-phase transactions

2017-03-27 Thread Craig Ringer
On 27 March 2017 at 17:53, Stas Kelvich wrote: > I’m heavily underestimated amount of changes there, but almost finished > and will send updated patch in several hours. Oh, brilliant! Please post whatever you have before you knock off for the day anyway, even if it's just a WIP, so I can pick it

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Tom Lane
Andres Freund writes: >> I personally find per-function annotation ala >> __attribute__((optimize("no-crossjumping"))) >> cleaner anyway. I tested that, and it seems to work. >> >> Obviously we'd have to hide that behind a configure test. Could also do >> tests based on __GNUC__ / __GNUC_MINOR_

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-03-27 Thread Daniel Verite
Vaishnavi Prabakaran wrote: > Please let me know if you think this is not enough but wanted to update > section 33.6 also? Yes, if the right place to call PQsetSingleRowMode() is immediately after PQbatchQueueProcess(), I think we need to update "33.6. Retrieving Query Results Row-By-Row"

Re: [HACKERS] Page Scan Mode in Hash Index

2017-03-27 Thread Ashutosh Sharma
Hi, > I think you should consider refactoring this so that it doesn't need > to use goto. Maybe move the while (offnum <= maxoff) logic into a > helper function and have it return itemIndex. If itemIndex == 0, you > can call it again. okay, Added a helper function for _hash_readpage(). Please c

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2017-03-27 Thread Tom Lane
"Tsunakawa, Takayuki" writes: > All other places in twophase.c and most places in other files put ereport() > and errmsg() on separate lines. I think it would be better to align with > surrounding code. > + ereport(FATAL, (errmsg("corrupted two-phase > file \"%s\""

Re: [HACKERS] [COMMITTERS] pgsql: Improve access to parallel query from procedural languages.

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 9:25 AM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Mar 27, 2017 at 1:48 AM, Rafia Sabih >> wrote: >>> This is caused because trigger related functions are marked safe and >>> using global variables, hence when executed in parallel are giving >>> incorrect output.

Re: [HACKERS] perlcritic

2017-03-27 Thread Dagfinn Ilmari Mannsåker
Peter Eisentraut writes: > On 3/1/17 11:21, Dagfinn Ilmari Mannsåker wrote: >> diff --git a/src/pl/plperl/plc_perlboot.pl b/src/pl/plperl/plc_perlboot.pl >> index 292c9101c9..b4212f5ab2 100644 >> --- a/src/pl/plperl/plc_perlboot.pl >> +++ b/src/pl/plperl/plc_perlboot.pl >> @@ -81,18 +81,15 @@ sub

Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall

2017-03-27 Thread Andreas Karlsson
Hi, Here is my review. I agree with the goal of the refactoring, as we want to make it easier to dump all the properties for the database object. But I think we need to solve the issues with the special casing of postgres and template1 which I personally would find very surprising if pg_dump

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-27 Thread Fabien COELHO
ISTM that PQExpBuffer is partially a memory leak. Something should need to be freed? I copied that pattern from somewhere else, so yeah, I duplicated whatever leak was there. Hmmm. Indeed some commands do not free, but there is a single use and the commands exits afterwards, eg "createuser

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 27, 2017 at 1:29 AM, Rushabh Lathia > wrote: >> But it seems a bit futile to produce the parallel plan in the first place, >> because with max_parallel_workers=0 we can't possibly get any parallel >> workers ever. I wonder why compute_parallel_worker() only looks

Re: [HACKERS] Logical decoding on standby

2017-03-27 Thread Craig Ringer
On 27 March 2017 at 16:20, Simon Riggs wrote: > On 27 March 2017 at 09:03, Craig Ringer wrote: > >> I think this one's ready to go. > > Looks like something I could commit. Full review by me while offline > today, aiming to commit tomorrow barring issues raised. Great. Meanwhile I'm going to be

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2017-03-27 Thread Alexander Korotkov
On Mon, Mar 27, 2017 at 4:48 PM, Tom Lane wrote: > "Tsunakawa, Takayuki" writes: > > All other places in twophase.c and most places in other files put > ereport() and errmsg() on separate lines. I think it would be better to > align with surrounding code. > > > + ere

Re: [HACKERS] standardized backwards incompatibility tag for commits

2017-03-27 Thread Robert Haas
On Sat, Mar 25, 2017 at 4:15 PM, Tom Lane wrote: > Andres Freund writes: >> Seems like it'd be good to standardize how we're declaring that a commit >> contains backwards incompatible changes. I've seen >> - 'BACKWARDS INCOMPATIBLE CHANGE' >> - 'BACKWARD INCOMPATIBILITY' >> - a lot of free-flow

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-27 Thread Corey Huinker
> > > I think that you could use another pattern where you init the > PQExpBufferData structure instead of create it, so that only the string is > malloced. In v26, I have the functions return PQExpBuffer. The two calling functions then free it, which should solve any leak. > > > I think that y

Re: [HACKERS] Time to drop old-style (V0) functions?

2017-03-27 Thread Tom Lane
Craig Ringer writes: > I didn't have any way to make > seg_l = (SEG *) DatumGetPointer(DirectFunctionCall2(seg_union, > PointerGetDatum(seg_l), > PointerGetDatum(sort_items[i].data))); > pretty, but *shrug*. For the builtin types, fmgr.h generally defines

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2017-03-27 Thread Tom Lane
Alexander Korotkov writes: > On Mon, Mar 27, 2017 at 4:48 PM, Tom Lane wrote: >> Actually, the *real* problem with that coding is it lacks a SQLSTATE >> (errcode call). The only places where it's acceptable to leave that >> out are for internal "can't happen" cases, which this surely isn't. > S

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-27 Thread Robert Haas
On Thu, Mar 23, 2017 at 8:54 PM, Amit Langote wrote: > On 2017/03/23 23:47, Amit Langote wrote: >> On Thu, Mar 23, 2017 at 11:27 PM, Maksim Milyutin >> wrote: >>> Hi! >>> >>> I have noticed that there is scheduled unlinking of nonexistent physical >>> storage under partitioned table when we execu

Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table

2017-03-27 Thread Robert Haas
On Fri, Feb 17, 2017 at 3:23 AM, Amit Langote wrote: > In certain cases, pg_dump's dumpTableSchema() emits a separate ALTER TABLE > command for those schema elements of a table that could not be included > directly in the CREATE TABLE command for the table. > > For example: > > create table p (a i

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-27 Thread Fabien COELHO
Hello, I think that you could use another pattern where you init the PQExpBufferData structure instead of create it, so that only the string is malloced. In v26, I have the functions return PQExpBuffer. The two calling functions then free it, which should solve any leak. Yep, it works as we

Re: [HACKERS] rename pg_log directory?

2017-03-27 Thread Peter Eisentraut
On 3/6/17 18:01, Andreas Karlsson wrote: > On 02/27/2017 03:05 PM, Peter Eisentraut wrote: >> How about changing the default for log_directory from 'pg_log' to, say, >> 'log'? > > I have attached a patch which does this. I do not care much about which > name is picked as long as we get rid off th

Re: [HACKERS] Partitioning vs ON CONFLICT

2017-03-27 Thread Robert Haas
On Thu, Mar 9, 2017 at 7:20 PM, Amit Langote wrote: > On 2017/03/10 9:10, Amit Langote wrote: >> On 2017/03/09 23:25, Robert Haas wrote: >>> On Fri, Feb 17, 2017 at 1:47 AM, Amit Langote wrote: I updated the patch. Now it's reduced to simply removing the check in transformInsertStmt() t

Re: [HACKERS] rename pg_log directory?

2017-03-27 Thread Andreas Karlsson
On 03/27/2017 04:38 PM, Peter Eisentraut wrote: Committed. Thanks! While digging around a bit, I found in release-old.sgml that before PostgreSQL 7.2, pg_clog was called pg_log. Go figure. Yeah, I noticed that too when writing the patch. :) Andreas -- Sent via pgsql-hackers mailing lis

Re: [HACKERS] partitioned tables and contrib/sepgsql

2017-03-27 Thread Robert Haas
On Thu, Mar 9, 2017 at 9:47 AM, Stephen Frost wrote: > While going over the contrib modules, I noticed that sepgsql was not > updated for partitioned tables. What that appears to mean is that it's > not possible to define labels on partitioned tables. It works for me: rhaas=# load 'dummy_seclab

Re: [HACKERS] Bug in get_partition_for_tuple

2017-03-27 Thread Robert Haas
On Wed, Mar 22, 2017 at 4:00 AM, Amit Langote wrote: >> You're right, fixed that in the attached updated patch. > > Added this to the partitioning open items list, to avoid being forgotten > about. > > https://wiki.postgresql.org/wiki/PostgreSQL_10_Open_Items#Partitioning Thanks for adding it the

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2017-03-27 Thread Alexander Korotkov
On Mon, Mar 27, 2017 at 11:26 AM, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: pgsql-hackers-ow...@postgresql.org > > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Michael Paquier > > Moved to CF 2017-03. Both patches still apply. > > Sorry to be late for reviewi

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-27 Thread Maksim Milyutin
On 24.03.2017 03:54, Amit Langote wrote: And here is the updated patch. Perhaps you forgot my fix in the updated patch diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 3999e6e..36917c8 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -1823

[HACKERS] logical replication worker and statistics

2017-03-27 Thread Fujii Masao
Hi, Logical replication worker should call pgstat_report_stat()? Currently it doesn't seem to do that and no statistics about table accesses by logical replication workers are collected. For example, this can prevent autovacuum from working on those tables properly. Regards, -- Fujii Masao --

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Andres Freund
On 2017-03-27 09:33:43 -0400, Tom Lane wrote: > Andres Freund writes: > > Checking for this isn't entirely pretty - see my attached attempt at > > doing so. I considered hiding > > __attribute__((optimize("no-crossjumping"))) in execInterpExpr.c behind > > a macro (like PG_DISABLE_CROSSJUMPING),

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Tom Lane
Andres Freund writes: > On 2017-03-27 09:33:43 -0400, Tom Lane wrote: >> I think it would, primarily because if we find out that some other compiler >> spells this differently, we could handle it totally within configure. > I'm unconvinced that we could sensibly map different compiler's options >

Re: [HACKERS] partitioned tables and contrib/sepgsql

2017-03-27 Thread Mike Palmiotto
On Mon, Mar 27, 2017 at 10:47 AM, Robert Haas wrote: > On Thu, Mar 9, 2017 at 9:47 AM, Stephen Frost wrote: >> While going over the contrib modules, I noticed that sepgsql was not >> updated for partitioned tables. What that appears to mean is that it's >> not possible to define labels on partit

Re: [HACKERS] Documentation improvements for partitioning

2017-03-27 Thread Robert Haas
On Thu, Mar 9, 2017 at 8:23 PM, Amit Langote wrote: > On 2017/03/10 3:26, Robert Haas wrote: >> I think you might have the titles for 0002 and 0003 backwards. > > Oops, you're right. > >> On Fri, Mar 3, 2017 at 2:51 AM, Amit Langote wrote: >>> 0002: some cosmetic fixes to create_table.sgml >> >> I

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-03-27 Thread Daniel Verite
Vaishnavi Prabakaran wrote: > Am going to include the test which you shared in the test patch. Please let > me know if you want to cover anymore specific cases to gain confidence. One bit of functionality that does not work in batch mode and is left as is by the patch is the PQfn() fast p

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Andres Freund
On 2017-03-27 11:22:40 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-03-27 09:33:43 -0400, Tom Lane wrote: > >> I think it would, primarily because if we find out that some other compiler > >> spells this differently, we could handle it totally within configure. > > > I'm unconvinced

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-27 Thread Corey Huinker
On Mon, Mar 27, 2017 at 10:34 AM, Fabien COELHO wrote: > > Hello, > > I think that you could use another pattern where you init the >>> PQExpBufferData structure instead of create it, so that only the string >>> is >>> malloced. >>> >> >> In v26, I have the functions return PQExpBuffer. The two c

Re: [HACKERS] PL/Python: Add cursor and execute methods to plan object

2017-03-27 Thread Peter Eisentraut
On 3/22/17 11:46, Andrew Dunstan wrote: > This is a very simple patch that does what it advertises. It applies > cleanly and provides tests for both the new methods (plan.cursor and > plan.execute). > > Marking Ready For Committer. committed -- Peter Eisentraut http://www.2ndQuadra

Re: [HACKERS] partitioned tables and contrib/sepgsql

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 11:22 AM, Mike Palmiotto wrote: > On Mon, Mar 27, 2017 at 10:47 AM, Robert Haas wrote: >> On Thu, Mar 9, 2017 at 9:47 AM, Stephen Frost wrote: >>> While going over the contrib modules, I noticed that sepgsql was not >>> updated for partitioned tables. What that appears t

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 9:54 AM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Mar 27, 2017 at 1:29 AM, Rushabh Lathia >> wrote: >>> But it seems a bit futile to produce the parallel plan in the first place, >>> because with max_parallel_workers=0 we can't possibly get any parallel >>> worker

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Tom Lane
As to the point of whether it actually helps or not ... on gcc 6.3.1 (Fedora 25), yes it does. Seems to be one "jmp *something" per EEO_NEXT or EEO_JUMP. on gcc 4.4.7 (RHEL 6), it makes things *WORSE*. We go from about half of the dispatches getting routed through a common location, to *all* of

Re: [HACKERS] segfault in hot standby for hash indexes

2017-03-27 Thread Jeff Janes
On Fri, Mar 24, 2017 at 12:49 AM, Amit Kapila wrote: > On Fri, Mar 24, 2017 at 12:25 PM, Ashutosh Sharma > wrote: > >> > >> I think it would have been probably okay to use *int* for ntuples as > >> that matches with what you are actually assigning in the function. > > > > okay, corrected it. Att

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Robert Haas
On Sat, Mar 25, 2017 at 12:18 PM, Rushabh Lathia wrote: > About the original issue reported by Tomas, I did more debugging and > found that - problem was gather_merge_clear_slots() was not returning > the clear slot when nreader is zero (means nworkers_launched = 0). > Due to the same scan was con

Re: [HACKERS] logical replication worker and statistics

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 11:14 AM, Fujii Masao wrote: > Logical replication worker should call pgstat_report_stat()? > Currently it doesn't seem to do that and no statistics about > table accesses by logical replication workers are collected. > For example, this can prevent autovacuum from working

Re: [HACKERS] [COMMITTERS] pgsql: Allow vacuums to report oldestxmin

2017-03-27 Thread Masahiko Sawada
On Sun, Mar 26, 2017 at 2:26 AM, Masahiko Sawada wrote: > On Sun, Mar 26, 2017 at 1:37 AM, Fujii Masao wrote: >> On Mon, Mar 6, 2017 at 9:37 PM, Masahiko Sawada >> wrote: >>> On Fri, Mar 3, 2017 at 10:50 PM, Simon Riggs wrote: Allow vacuums to report oldestxmin Allow VACUUM and

Re: [HACKERS] partitioned tables and contrib/sepgsql

2017-03-27 Thread Mike Palmiotto
On Mon, Mar 27, 2017 at 11:46 AM, Robert Haas wrote: > On Mon, Mar 27, 2017 at 11:22 AM, Mike Palmiotto > wrote: >> On Mon, Mar 27, 2017 at 10:47 AM, Robert Haas wrote: >>> On Thu, Mar 9, 2017 at 9:47 AM, Stephen Frost wrote: While going over the contrib modules, I noticed that sepgsql was

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread David Rowley
On 28 March 2017 at 04:57, Robert Haas wrote: > On Sat, Mar 25, 2017 at 12:18 PM, Rushabh Lathia > wrote: >> About the original issue reported by Tomas, I did more debugging and >> found that - problem was gather_merge_clear_slots() was not returning >> the clear slot when nreader is zero (means

Re: [HACKERS] Guidelines for GSoC student proposals / Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-03-27 Thread Kevin Grittner
On Sat, Mar 25, 2017 at 9:24 PM, Mengxing Liu wrote: > I've updated the proposal according to your comments. > But I am still wondering that can you review it for a double-check > to make sure I've made everything clear? Additional comments added. I'm afraid a few new issues came to mind readin

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Tom Lane
I wrote: > As to the point of whether it actually helps or not ... > on gcc 4.4.7 (RHEL 6), it makes things *WORSE*. We go from about half of > the dispatches getting routed through a common location, to *all* of them > (except one; for some odd reason the first EEO_NEXT in EEOP_NULLIF > survives

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Andres Freund
On 2017-03-27 11:52:05 -0400, Tom Lane wrote: > As to the point of whether it actually helps or not ... > > on gcc 6.3.1 (Fedora 25), yes it does. Seems to be one "jmp *something" > per EEO_NEXT or EEO_JUMP. > > on gcc 4.4.7 (RHEL 6), it makes things *WORSE*. We go from about half of > the disp

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of find_all_inheritors()

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 12:08 PM, Teodor Sigaev wrote: > Improve performance of find_all_inheritors() > > Previous coding uses three nested loops which obviously were a pain for > large number of table's children. Patch replaces inner loop with > a hashmap. > > Author: Aleksander Alekseev > Review

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 12:11 PM, David Rowley wrote: > On 28 March 2017 at 04:57, Robert Haas wrote: >> On Sat, Mar 25, 2017 at 12:18 PM, Rushabh Lathia >> wrote: >>> About the original issue reported by Tomas, I did more debugging and >>> found that - problem was gather_merge_clear_slots() was

Re: [HACKERS] Potential data loss of 2PC files

2017-03-27 Thread Teodor Sigaev
Thank you. One more question: what about symlinks? If DBA moves, for example, pg_xact to another dist and leaves the symlink in data directoty. Suppose, fsync on symlink will do nothing actually. I did not think of this case, but is that really common? There is even I saw a lot such cases. If

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 27, 2017 at 9:54 AM, Tom Lane wrote: >> Since this has now come up twice, I suggest adding a comment there >> that explains why we're intentionally ignoring max_parallel_workers. > Good idea. How about the attached? WFM ... but seems like there should be some

Re: [HACKERS] Potential data loss of 2PC files

2017-03-27 Thread Teodor Sigaev
Thank you, pushed Michael Paquier wrote: On Fri, Mar 24, 2017 at 11:36 PM, Teodor Sigaev wrote: And the renaming of pg_clog to pg_xact is also my fault. Attached is an updated patch. Thank you. One more question: what about symlinks? If DBA moves, for example, pg_xact to another dist and le

Re: [HACKERS] segfault in hot standby for hash indexes

2017-03-27 Thread Ashutosh Sharma
>> >> >> >> I think it would have been probably okay to use *int* for ntuples as >> >> that matches with what you are actually assigning in the function. >> > >> > okay, corrected it. Attached is newer version of patch. >> > >> >> Thanks, this version looks good to me. > > > It solves the problem f

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Robert Haas
On Mon, Mar 27, 2017 at 12:26 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Mar 27, 2017 at 9:54 AM, Tom Lane wrote: >>> Since this has now come up twice, I suggest adding a comment there >>> that explains why we're intentionally ignoring max_parallel_workers. > >> Good idea. How about t

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-27 Thread Rushabh Lathia
On Mon, Mar 27, 2017 at 9:52 PM, Robert Haas wrote: > On Mon, Mar 27, 2017 at 12:11 PM, David Rowley > wrote: > > On 28 March 2017 at 04:57, Robert Haas wrote: > >> On Sat, Mar 25, 2017 at 12:18 PM, Rushabh Lathia > >> wrote: > >>> About the original issue reported by Tomas, I did more debuggi

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-27 Thread Andres Freund
On 2017-03-27 12:18:37 -0400, Tom Lane wrote: > I wrote: > > As to the point of whether it actually helps or not ... > > on gcc 4.4.7 (RHEL 6), it makes things *WORSE*. We go from about half of > > the dispatches getting routed through a common location, to *all* of them > > (except one; for some

  1   2   >