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

2017-03-12 Thread Fabien COELHO
Hello Tom, * Daniel Verite previously pointed out the desirability of disabling variable expansion while skipping script. That doesn't seem to be here, ISTM that it is still there, but for \elif conditions which are currently always checked. fabien=# \if false fabien@# \echo `echo

Re: [HACKERS] issue about the streaming replication

2017-03-12 Thread Michael Paquier
On Sun, Mar 12, 2017 at 5:24 PM, Jinhua Luo wrote: > I think this diverge scenario is common, because it's likely the > master would crash due to some hardware issue (e.g. power off) which > would cause some committed transaction has not yet synced to slave, > while the slave

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

2017-03-12 Thread Tom Lane
Corey Huinker writes: > Reading this, I started to wonder "so how did I get that impression?" and I > found this from Feb 9: > IMO, an erroneous backslash command should have no effect, period. > "It failed but we'll treat it as if it were valid" is a rathole > I don't

[HACKERS] issue about the streaming replication

2017-03-12 Thread Jinhua Luo
Hi, I make a test to see how postgresql handle replication diverge problem: a) setup two pg cluster A and B b) run A as master, B as salve, using streaming replication c) insert some data into table foobar on A, shutdown the network between A and B at the meantime, which ends up some data would

Re: [HACKERS] Parallel Append implementation

2017-03-12 Thread Tels
Moin, On Sat, March 11, 2017 11:29 pm, Robert Haas wrote: > On Fri, Mar 10, 2017 at 6:01 AM, Tels > wrote: >> Just a question for me to understand the implementation details vs. the >> strategy: >> >> Have you considered how the scheduling decision might impact

Re: [HACKERS] scram and \password

2017-03-12 Thread Joe Conway
On 03/11/2017 11:07 PM, Michael Paquier wrote: > Having a RLS on pg_authid to allow a user to look at its own password > type is an idea. Given that that is not likely at this stage of the dev cycle, what about a special purpose SQL function that returns the password type for the current user? Or

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

2017-03-12 Thread Corey Huinker
On Sun, Mar 12, 2017 at 1:52 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > > Oddly, Corey was using you as support for this position...though without an actual quote: > > """ Reading this, I started to wonder "so how did I get that impression?" and I found this from Feb 9: IMO, an

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

2017-03-12 Thread David G. Johnston
On Sun, Mar 12, 2017 at 10:24 AM, Tom Lane wrote: > > One point here is that we need to distinguish problems in the expression, > which could arise from changing variable values, from some other types of > mistakes like \elif with no preceding \if. When you see something

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

2017-03-12 Thread Corey Huinker
> > > (1) document that \if-related commands MUST be on their own > line (i.e. like cpp #if directives?). > I have no opinion on whether \if-related comments must be on their own line, though I coded as if that were the case. I want to point out that the goal down the road is to allow

[HACKERS] bugfix: xpath encoding issue

2017-03-12 Thread Pavel Stehule
Hi When I tested XMLTABLE function I found a bug of XPATH function - xpath_internal There xmltype is not correctly encoded to xmlChar due possible invalid encoding info in header. It is possible when XML was loaded with recv function and has not UTF8 encoding. The functions based on xml_parse

Re: [HACKERS] possible encoding issues with libxml2 functions

2017-03-12 Thread Pavel Stehule
2017-03-12 21:57 GMT+01:00 Noah Misch : > On Sun, Mar 12, 2017 at 08:36:58PM +0100, Pavel Stehule wrote: > > 2017-03-12 0:56 GMT+01:00 Noah Misch : > > > On Mon, Feb 20, 2017 at 07:48:18PM +0100, Pavel Stehule wrote: > > > > There are possible two fixes > > >

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

2017-03-12 Thread Tom Lane
"David G. Johnston" writes: > There are only four commands and a finite number of usage permutations. > Enumerating and figuring out the proper behavior for each should be done. > Thus - ​If the expressions are bad they are considered false but the block > is created

Re: [HACKERS][REVIEW] macaddr 64 bit (EUI-64) datatype support

2017-03-12 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * Haribabu Kommi (kommi.harib...@gmail.com) wrote: > > On Wed, Feb 1, 2017 at 6:27 AM, Vitaly Burovoy > > wrote: > > > The new status of this patch is: Ready for Committer > > > > Thanks for the review. > >

Re: [HACKERS][REVIEW] macaddr 64 bit (EUI-64) datatype support

2017-03-12 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * Stephen Frost (sfr...@snowman.net) wrote: > > * Haribabu Kommi (kommi.harib...@gmail.com) wrote: > > > On Wed, Feb 1, 2017 at 6:27 AM, Vitaly Burovoy > > > wrote: > > > > The new status of this patch is: Ready

Re: [HACKERS] delta relations in AFTER triggers

2017-03-12 Thread Thomas Munro
On Fri, Mar 10, 2017 at 11:48 AM, Kevin Grittner wrote: > On Tue, Mar 7, 2017 at 6:28 PM, Kevin Grittner wrote: > >> New patch attached. > > And bit-rotted less than 24 hours later by fcec6caa. > > New patch attached just to fix bit-rot. > > That conflicting

Re: [HACKERS] Other formats in pset like markdown, rst, mediawiki

2017-03-12 Thread Jan Michálek
2017-03-10 9:43 GMT+01:00 Jan Michálek : > > > 2017-03-09 20:10 GMT+01:00 Peter Eisentraut com>: > >> This is looking pretty neat. I played around with it a bit. There are >> a couple of edge cases that you need to address, I think. >> >

Re: [HACKERS] possible encoding issues with libxml2 functions

2017-03-12 Thread Pavel Stehule
2017-03-12 0:56 GMT+01:00 Noah Misch : > On Mon, Feb 20, 2017 at 07:48:18PM +0100, Pavel Stehule wrote: > > Today I played with xml_recv function and with xml processing functions. > > > > xml_recv function ensures correct encoding from document encoding to > server > >

Re: [HACKERS] possible encoding issues with libxml2 functions

2017-03-12 Thread Noah Misch
On Sun, Mar 12, 2017 at 08:36:58PM +0100, Pavel Stehule wrote: > 2017-03-12 0:56 GMT+01:00 Noah Misch : > > On Mon, Feb 20, 2017 at 07:48:18PM +0100, Pavel Stehule wrote: > > > There are possible two fixes > > > > > > a) clean decl on input - the encoding info can be removed

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

2017-03-12 Thread Robert Haas
On Fri, Mar 10, 2017 at 2:17 PM, Peter Eisentraut wrote: > On 3/2/17 21:40, Robert Haas wrote: >> On the point mentioned above, I >> don't think adding a partition should move tuples, necessarily; seems >> like it would be good enough - maybe better - for it to

Re: [HACKERS] [NOVICE] Why is there a doubtful copyObject call in add_vars_to_targetlist

2017-03-12 Thread David Rowley
(Redirecting to Hackers, since Novice is not the correct place for this question) On 13 March 2017 at 14:22, Neha Khatri wrote: > Hi, > > I was debugging that when does the function _copyVar get invoked, and the > first hit for that was in the add_vars_to_targetlist.

Re: [HACKERS] REINDEX CONCURRENTLY 2.0

2017-03-12 Thread Andreas Karlsson
On 03/13/2017 03:11 AM, Andreas Karlsson wrote: I also fixed the the code to properly support triggers. And by "support triggers" I actually meant fixing the support for moving the foreign keys to the new index. Andreas -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] Allow interrupts on waiting standby

2017-03-12 Thread Michael Paquier
On Wed, Mar 8, 2017 at 5:45 AM, Peter Eisentraut wrote: > On 1/30/17 20:34, Michael Paquier wrote: >> Both things are fixed in the new version attached. I have added as >> well this patch to the next commit fest: >> https://commitfest.postgresql.org/13/977/ > >

Re: [HACKERS] scram and \password

2017-03-12 Thread Robert Haas
On Fri, Mar 10, 2017 at 5:43 PM, Michael Paquier wrote: > On Sat, Mar 11, 2017 at 2:53 AM, Jeff Janes wrote: >> Should the \password tool in psql inspect password_encryption and act on it >> being 'scram'? > > Not sure if it is wise to change the

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2017-03-12 Thread Peter Geoghegan
On Sun, Mar 12, 2017 at 3:05 PM, Peter Geoghegan wrote: > There is still an open item here, though: The leader-as-worker > Tuplesortstate, a special case, can still leak files. I phrased this badly. What I mean is that there can be instances where temp files are left on disk

Re: [HACKERS] REINDEX CONCURRENTLY 2.0

2017-03-12 Thread Andreas Karlsson
On 03/02/2017 03:10 AM, Michael Paquier wrote: On Wed, Mar 1, 2017 at 2:21 AM, Andreas Karlsson wrote: +/* + * Copy contraint flags for old index. This is safe because the old index + * guaranteed uniquness. + */ +newIndexForm->indisprimary =

Re: [HACKERS] PassDownLimitBound for ForeignScan/CustomScan [take-2]

2017-03-12 Thread Kouhei Kaigai
> Hello, > > On Wed, March 1, 2017 7:21 pm, Kouhei Kaigai wrote: > >> I've looked at the patch, and as I'm not that familiar with the > >> pg-sourcecode, customs and so on, this isn't a review, more like food > >> for thought and all should be taken with a grain of salt. :) > >> > >> So here are

Re: [HACKERS] make async slave to wait for lsn to be replayed

2017-03-12 Thread Thomas Munro
On Fri, Mar 10, 2017 at 1:49 AM, Ivan Kartyshov wrote: > Here I attached rebased patch waitlsn_10dev_v3 (core feature) > I will leave the choice of implementation (core/contrib) to the discretion > of the community. > > Will be glad to hear your suggestion about

Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2017-03-12 Thread Venkata B Nagothi
On Tue, Jan 17, 2017 at 9:36 PM, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello. I added pgsql-hackers. > > This occurs also on git master and back to 9.4. > > At Fri, 13 Jan 2017 08:47:06 -0600, Jonathon Nelson > wrote in

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

2017-03-12 Thread Craig Ringer
On 13 March 2017 at 08:54, Vaishnavi Prabakaran wrote: > Before going with this fix, I would like you to consider the option of > asking batch processing users(via documentation) to set single-row mode > before calling PQgetResult(). > Either way we need to fix the

Re: [HACKERS] scram and \password

2017-03-12 Thread Michael Paquier
On Mon, Mar 13, 2017 at 12:48 AM, Joe Conway wrote: > On 03/11/2017 11:07 PM, Michael Paquier wrote: >> Having a RLS on pg_authid to allow a user to look at its own password >> type is an idea. > > Given that that is not likely at this stage of the dev cycle, what about > a

Re: [HACKERS] Logical replication existing data copy

2017-03-12 Thread Craig Ringer
On 11 March 2017 at 00:33, Petr Jelinek wrote: > On 09/03/17 18:48, Peter Eisentraut wrote: >> On 3/6/17 05:27, Petr Jelinek wrote: >>> And lastly I changed the automagic around exporting, not exporting and >>> using the snapshot produced by CREATE_REPLICATION_SLOT

Re: [HACKERS] Need a builtin way to run all tests faster manner

2017-03-12 Thread Andres Freund
0;115;0c On 2017-03-11 22:14:07 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2017-03-11 11:48:31 -0800, Andres Freund wrote: > >> I think that'd be a good plan. We probably should also keep --outputdir > >> seperate (which test_decoding/Makefile does, but > >>

Re: [HACKERS] asynchronous execution

2017-03-12 Thread Amit Langote
On 2017/03/11 8:19, Corey Huinker wrote: > > On Thu, Feb 23, 2017 at 6:59 AM, Kyotaro HORIGUCHI > > > wrote: > > 9e43e87 > > > Patch fails on current master, but correctly applies to 9e43e87. Thanks > for including

Re: [HACKERS] scram and \password

2017-03-12 Thread Michael Paquier
On Mon, Mar 13, 2017 at 9:15 AM, Robert Haas wrote: > On Fri, Mar 10, 2017 at 5:43 PM, Michael Paquier > wrote: >> On Sat, Mar 11, 2017 at 2:53 AM, Jeff Janes wrote: >>> Should the \password tool in psql inspect

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2017-03-12 Thread Peter Geoghegan
On Thu, Feb 16, 2017 at 8:45 AM, Peter Geoghegan wrote: >> I do not think there should be any reason why we can't get the >> resource accounting exactly correct here. If a single backend manages >> to remove every temporary file that it creates exactly once (and >> that's currently

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

2017-03-12 Thread Vaishnavi Prabakaran
On Sat, Mar 11, 2017 at 12:52 AM, Daniel Verite wrote: > Hi, > > I notice that PQsetSingleRowMode() doesn't work when getting batch results. > > The function is documented as: > " int PQsetSingleRowMode(PGconn *conn); > > This function can only be called immediately

Re: [HACKERS] BRIN cost estimate

2017-03-12 Thread David Rowley
On 2 March 2017 at 04:40, Alvaro Herrera wrote: > Alvaro Herrera wrote: > >> I have added this patch to the commitfest, which I've been intending to >> get in for a long time. I'll be submitting an updated patch, if needed. > > Here is Emre's patch rebased to current

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-12 Thread Craig Ringer
On 11 March 2017 at 14:32, Craig Ringer wrote: > I'll extract this part of the patch so it can be looked at separately, > it'll be clearer that way. Apparently I thought that last time too since I already posted it split up. Ahem. Working on too many different things at

Re: [HACKERS] Logical decoding on standby

2017-03-12 Thread Craig Ringer
On 13 March 2017 at 10:56, Craig Ringer wrote: > On 7 March 2017 at 21:08, Simon Riggs wrote: > >> Patch 4 committed. Few others need rebase. > > Since this patch series and initial data copy for logical replication > both add a facility for

Re: [HACKERS] [NOVICE] Why is there a doubtful copyObject call in add_vars_to_targetlist

2017-03-12 Thread Neha Khatri
On Mon, Mar 13, 2017 at 3:52 PM, Tom Lane wrote: > David Rowley writes: > > On 13 March 2017 at 14:22, Neha Khatri wrote: > >> This copyObject still exits in the current code. So I was wondering if > the > >> comment

Re: [HACKERS] asynchronous execution

2017-03-12 Thread Corey Huinker
> > > I think it will, because Append itself has been made async-capable by one > of the patches and UNION ALL uses Append. But as mentioned above, only > the postgres_fdw foreign tables will be able to utilize this for now. > > Ok, I'll re-run my test from a few weeks back and see if anything

Re: [HACKERS] [NOVICE] Why is there a doubtful copyObject call in add_vars_to_targetlist

2017-03-12 Thread Neha Khatri
Sure, understood. Regards, Neha

Re: [HACKERS] issue about the streaming replication

2017-03-12 Thread Jinhua Luo
Thanks for your information. Now I know the pg_rewind tool. But why PG does not recover the diverge automatically? There exists two options at least, analogy to what "git merge" does: a) the old master find out and rewind itself to the common base of the new master in the WAL history before

Re: [HACKERS] Other formats in pset like markdown, rst, mediawiki

2017-03-12 Thread Jan Michálek
I find, there is problem in tab indent in rst, it looks that lines should be aligned to left in some cases. 2017-03-10 9:43 GMT+01:00 Jan Michálek : > > > 2017-03-09 20:10 GMT+01:00 Peter Eisentraut com>: > >> This is looking pretty neat.

Re: [HACKERS] Bug in get_partition_for_tuple

2017-03-12 Thread Jeevan Ladhe
Hi Amit, I was able to reproduce the crash, and with the attached patch the crash goes away. Also, "make check-world" passes clean. Patch looks good to me. However, In following comment in your test: -- check routing error through a list partitioned table when they key is null I think you want

Re: [HACKERS] Bug in get_partition_for_tuple

2017-03-12 Thread Amit Langote
Hi Jeevan, On 2017/03/13 14:31, Jeevan Ladhe wrote: > Hi Amit, > > I was able to reproduce the crash, and with the attached patch the crash > goes > away. Also, "make check-world" passes clean. > > Patch looks good to me. Thanks for the review. > However, In following comment in your test: >

Re: [HACKERS] Need a builtin way to run all tests faster manner

2017-03-12 Thread Tom Lane
Andres Freund writes: > On 2017-03-11 22:14:07 -0500, Tom Lane wrote: >> This looks generally sane to me, although I'm not very happy about folding >> the "$(MKDIR_P) output_iso" call into pg_isolation_regress_check --- that >> seems weird and unlike the way it's done for the

Re: [HACKERS] [NOVICE] Why is there a doubtful copyObject call in add_vars_to_targetlist

2017-03-12 Thread Tom Lane
Neha Khatri writes: > Then, should it be alright to remove the doubt itself? It's a perfectly legitimate comment describing a potential optimization. There are lots of other similar comments that might or might not ever get addressed. regards, tom

Re: [HACKERS] wait events for disk I/O

2017-03-12 Thread Rajkumar Raghuwanshi
On Thu, Mar 9, 2017 at 10:54 AM, Rushabh Lathia wrote: > Thanks Rajkumar for performing tests on this patch. > > Yes, I also noticed similar results in my testing. Additionally sometime I > also > noticed ReadSLRUPage event on my system. > > I also run the reindex

Re: [HACKERS] PATCH: pageinspect / add page_checksum and bt_page_items(bytea)

2017-03-12 Thread Ashutosh Sharma
Hi, I had a look into this patch and would like to share some of my review comments that requires author's attention. 1) The comment for page_checksum() needs to be corrected. It seems like it has been copied from page_header and not edited it further. /* * page_header * * Allows inspection

Re: [HACKERS] [NOVICE] Why is there a doubtful copyObject call in add_vars_to_targetlist

2017-03-12 Thread Tom Lane
David Rowley writes: > On 13 March 2017 at 14:22, Neha Khatri wrote: >> This copyObject still exits in the current code. So I was wondering if the >> comment question still holds good and why the question there in first place. >> To make a new

Re: [HACKERS] Page Scan Mode in Hash Index

2017-03-12 Thread Ashutosh Sharma
Hi, > > I've assigned to review this patch. > At first, I'd like to notice that I like idea and general design. > Secondly, patch set don't apply cleanly to master. Please, rebase it. Thanks for showing your interest towards this patch. I would like to inform that this patch has got dependency