Re: json results parsing

2018-05-30 Thread Michael Paquier
On Wed, May 30, 2018 at 08:16:18PM -0700, Charles Cui wrote: > Basically, I want to call these json API inside a plugin, and the return > value for these APIs are Datum. I am wondering how to parse a set of json > results from Datum in postgresql? Seems the helper functions I am aware of > are

Re: ALTER CONSTRAINT change action

2018-05-30 Thread Euler Taveira
2018-05-30 13:23 GMT-03:00 Jeff Janes : > Currently you can't change the ON DELETE action or ON UPDATE action of an > existing constraint. You have to drop the constraint and create it again > with the action you want. This is not a light-weight activity, as it has to > validate the new

Re: I'd like to discuss scaleout at PGCon

2018-05-30 Thread Robert Haas
On Sun, May 27, 2018 at 1:20 AM, MauMau wrote: > I'm going to attend PGCon in Ottawa for the first time. I am happy if > I can meet you. It was nice to meet you in person. > I'd like to have a session on scaleout design at the unconference. > I've created a wiki page for that (this is still

Re: Add --include-table-data-where option to pg_dump, to export only a subset of table data

2018-05-30 Thread Carter Thaxton
After some consideration, I've created a new patch that addresses even more of the various concerns. Most notably, the command-line option is shortened to simply --where, which is much easier to read and understand, and matches the earlier proposal [1]. > bool >

Re: New GUC to sample log queries

2018-05-30 Thread David Rowley
On 31 May 2018 at 06:44, Adrien Nayrat wrote: > Here is a naive SELECT only bench with a dataset which fit in ram (scale > factor > = 100) and PGDATA and log on a ramdisk: > shared_buffers = 4GB > seq_page_cost = random_page_cost = 1.0 > logging_collector = on (no rotation) It would be better

Re: Undo logs

2018-05-30 Thread Thomas Munro
Hi Simon, On Mon, May 28, 2018 at 11:40 PM, Simon Riggs wrote: > On 24 May 2018 at 23:22, Thomas Munro wrote: >> The lowest level piece of this work is a physical undo log manager, > >> 1. Efficient appending of new undo data from many concurrent >> backends. Like logs. >> 2. Efficient

Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode

2018-05-30 Thread Michael Paquier
On Wed, May 30, 2018 at 03:36:27PM -0400, Tom Lane wrote: > I'm wondering about some sort of version skew or misinstallation on > the Perl side --- say, header files that we're using to compile > that don't match the libperl.so used at runtime. Tony, was the compiler used gcc or xlc? Support for

Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode

2018-05-30 Thread Tom Lane
Alvaro Herrera writes: > It's pretty obvious that the transform is broken on your platform. Seems so, but why? The code involved doesn't look very machine-dependent. I'm wondering about some sort of version skew or misinstallation on the Perl side --- say, header files that we're using to

Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode

2018-05-30 Thread Alvaro Herrera
On 2018-May-30, REIX, Tony wrote: > 32bit: 2 failures: >== running regression test queries == >test jsonb_plperl ... FAILED >test jsonb_plperlu ... FAILED > > Expected/Result logs attached to this email. This is not particularly helpful. Please send the

New GUC to sample log queries

2018-05-30 Thread Adrien Nayrat
Hello hackers, In case of OLTP trafic it is hard to catch fast queries in logs (for example, you want to know parameters for only few queries). You have to put log_min_duration_statement to 0, do a reload, wait a few seconds/minutes, back log_min_duration_statement to a previous value and reload

Re: behave of --create-slot option

2018-05-30 Thread Michael Paquier
On Tue, May 29, 2018 at 09:21:00PM +0200, Pavel Stehule wrote: > 2018-05-29 16:53 GMT+02:00 Euler Taveira : >> If pg_basebackup failed for some other reason *after* the replication >> slot was created (say, permission problem) then we should try to >> cleanup the old slot. That should be the

Re: Few comments on commit 857f9c36 (skip full index scans )

2018-05-30 Thread Teodor Sigaev
I think it will always be set to BTREE_VERSION (See _bt_restore_meta). You are right, pushed. Thank you! -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

ALTER CONSTRAINT change action

2018-05-30 Thread Jeff Janes
Currently you can't change the ON DELETE action or ON UPDATE action of an existing constraint. You have to drop the constraint and create it again with the action you want. This is not a light-weight activity, as it has to validate the new constraint. Is there a fundamental reason that ALTER

Avoid extra Sort nodes between WindowAggs when sorting can be reused

2018-05-30 Thread Daniel Gustafsson
Currently, we can only reuse Sort nodes between WindowAgg nodes iff the partitioning and ordering clauses are identical. If a window Sort node sortorder is a prefix of another window, we could however reuse the Sort node to hopefully produce a cheaper plan. In

Re: POC: GROUP BY optimization

2018-05-30 Thread Teodor Sigaev
Cosmetics change: remove find_sort_group_clause_by_sortref() function added in v5 patch version because it duplicates existsing get_sortgroupref_clause(). -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW:

Re: Few comments on commit 857f9c36 (skip full index scans )

2018-05-30 Thread Amit Kapila
On Wed, May 30, 2018 at 9:09 PM, Teodor Sigaev wrote: >> The metapage upgrade should be performed under critical section. > > > Agree. But after close look I found that btm_version change isn't wal-logged > (near line 2251 in _bt_newroot). So btm_version is not propagated to > replica/backup/etc.

Re: Proposal: Partitioning Advisor for PostgreSQL

2018-05-30 Thread Ashutosh Bapat
On Thu, May 24, 2018 at 4:16 PM, Yuzuko Hosoya wrote: > Hello, > > I'm Yuzuko Hosoya. This is my first PostgreSQL project participation. > > I have been developing partitioning advisor prototype with Julien Rouhaud. > It will be a new feature of HypoPG[1], which is a PostgreSQL extension, and >

Re: Few comments on commit 857f9c36 (skip full index scans )

2018-05-30 Thread Teodor Sigaev
The metapage upgrade should be performed under critical section. Agree. But after close look I found that btm_version change isn't wal-logged (near line 2251 in _bt_newroot). So btm_version is not propagated to replica/backup/etc. I believe it should be fixed. -- Teodor Sigaev

Re: PATCH pass PGOPTIONS to pg_regress

2018-05-30 Thread Michael Paquier
On Wed, May 30, 2018 at 12:28:27PM +0300, Ildar Musin wrote: > Here extra.conf is implied to be a file in extension's root directory which > contains additional server options. > This would only work for `make check` though, not `make installcheck`. REGRESS_OPTS is more widely known for this

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-05-30 Thread Daniel Gustafsson
> On 30 May 2018, at 09:36, Ashutosh Bapat > wrote: > > On Tue, May 29, 2018 at 9:10 PM, Daniel Gustafsson wrote: >> There are a couple of places in postgres_fdw where we check if the Bitmapset >> has multiple members using bms_num_members(), without storing the returned >> count. The

Re: Incorrect visibility test function assigned to snapshot

2018-05-30 Thread Antonin Houska
Andres Freund wrote: > On May 30, 2018 9:45:32 AM EDT, Antonin Houska wrote: > >Alvaro Herrera wrote: > > > >> On 2018-May-30, Antonin Houska wrote: > >> > >> > In the header comment, SnapBuildInitialSnapshot() claims to set > >> > snapshot->satisfies to the HeapTupleSatisfiesMVCC test

Re: Incorrect visibility test function assigned to snapshot

2018-05-30 Thread Andres Freund
On May 30, 2018 9:45:32 AM EDT, Antonin Houska wrote: >Alvaro Herrera wrote: > >> On 2018-May-30, Antonin Houska wrote: >> >> > In the header comment, SnapBuildInitialSnapshot() claims to set >> > snapshot->satisfies to the HeapTupleSatisfiesMVCC test function, >and indeed it >> > converts

Re: Incorrect visibility test function assigned to snapshot

2018-05-30 Thread Antonin Houska
Alvaro Herrera wrote: > On 2018-May-30, Antonin Houska wrote: > > > In the header comment, SnapBuildInitialSnapshot() claims to set > > snapshot->satisfies to the HeapTupleSatisfiesMVCC test function, and indeed > > it > > converts the "xid" array to match its semantics (i.e. the xid items >

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-05-30 Thread Ashutosh Bapat
On Tue, May 29, 2018 at 9:10 PM, Daniel Gustafsson wrote: > There are a couple of places in postgres_fdw where we check if the Bitmapset > has multiple members using bms_num_members(), without storing the returned > count. The attached patch instead use bms_membership() which is optimized for >

Re: Incorrect visibility test function assigned to snapshot

2018-05-30 Thread Alvaro Herrera
On 2018-May-30, Antonin Houska wrote: > In the header comment, SnapBuildInitialSnapshot() claims to set > snapshot->satisfies to the HeapTupleSatisfiesMVCC test function, and indeed it > converts the "xid" array to match its semantics (i.e. the xid items eventually > represent running

Re: Is a modern build system acceptable for older platforms

2018-05-30 Thread Geoff Winkless
On Wed, 30 May 2018 at 00:51, Yuriy Zhuravlev wrote: > You are totally wrong, I didn't it, especial called somebody "old". > ​Then I apologise for misunderstanding your intention. Language/culture barrier perhaps? Geoff >

Re: [GSoC] json helper functions

2018-05-30 Thread Andrew Dunstan
On Wed, May 30, 2018 at 12:42 AM, Charles Cui wrote: > Hi mentors and hackers, > > I am working on providing a new plugin where creates new data type > (thrift). What I am currently planning is to translate cstring to byte for > thrift_in functions. The cstring should be json format. When I

PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode

2018-05-30 Thread REIX, Tony
Hi, 64bit: all tests are OK. 32bit: 2 failures: == running regression test queries == test jsonb_plperl ... FAILED test jsonb_plperlu ... FAILED Expected/Result logs attached to this email. Perl 5.24.0 . Any idea? What about tests on Linux on i686 ? Regards,