[GSoC] json helper functions

2018-05-29 Thread Charles Cui
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 looking at json helper functions I find the header ./include/ser

Re: Performance regression with PostgreSQL 11 and partitioning

2018-05-29 Thread David Rowley
On 26 May 2018 at 02:30, Thomas Reiss wrote: > I spent some time to test the new features on partitioning with the > beta1. I noticed a potentially huge performance regression with > plan-time partition pruning. Thanks for reporting. I've added this item to the PG11 open items list in: https://w

Re: Supporting tls-server-end-point as SCRAM channel binding for OpenSSL 1.0.0 and 1.0.1

2018-05-29 Thread Michael Paquier
On Tue, May 29, 2018 at 10:33:03PM -0400, Heikki Linnakangas wrote: > Hmm. I think Peter went through this in commits ac3ff8b1d8 and 054e8c6cdb. > If you got that working now, I suppose we could do that, but I'm actually > inclined to just stick to the current, more straightforward code, and > requ

Re: Supporting tls-server-end-point as SCRAM channel binding for OpenSSL 1.0.0 and 1.0.1

2018-05-29 Thread Heikki Linnakangas
On 29/05/18 17:02, Michael Paquier wrote: Currently, the SCRAM channel binding tls-server-end-point is supported only with OpenSSL 1.0.2 and newer versions as we rely on X509_get_signature_nid to get the certificate signature ID, which is the official way of upstream to get this information as al

Re: Looks like we can enable AF_UNIX on Windows now

2018-05-29 Thread Craig Ringer
On 30 May 2018 at 09:53, Andres Freund wrote: > > > On May 29, 2018 9:44:09 PM EDT, Craig Ringer > wrote: > >https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_ > unix-comes-to-windows/ > > > >The latest Windows 10 update shipped with AF_UNIX socket support for > >win32 > >sockets. > > >

Re: Performance regression with PostgreSQL 11 and partitioning

2018-05-29 Thread David Rowley
On 26 May 2018 at 09:17, Tom Lane wrote: > I'm inclined to think that we should flush find_appinfos_by_relids > altogether, along with these inefficient intermediate arrays, and instead > have the relevant places in adjust_appendrel_attrs call some function > defined as "gimme the AppendRelInfo fo

Re: Looks like we can enable AF_UNIX on Windows now

2018-05-29 Thread Andres Freund
On May 29, 2018 9:44:09 PM EDT, Craig Ringer wrote: >https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/ > >The latest Windows 10 update shipped with AF_UNIX socket support for >win32 >sockets. > >It's not that exciting because it doesn't support socketpair() or fd

Looks like we can enable AF_UNIX on Windows now

2018-05-29 Thread Craig Ringer
https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/ The latest Windows 10 update shipped with AF_UNIX socket support for win32 sockets. It's not that exciting because it doesn't support socketpair() or fd passing - yet. So really it doesn't offer us much more than we

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-29 Thread Alvaro Herrera
On 2018-May-29, Alvaro Herrera wrote: > I added an Assert(DatabasePath != NULL) to > RelationCacheInitFilePreInvalidate() and didn't see a single crash when > running the tests. I thought that adding a "VACUUM FREEZE pg_class" > in the recovery tests (where there is a standby) ought to do it, but

Re: Is a modern build system acceptable for older platforms

2018-05-29 Thread Yuriy Zhuravlev
> > Arguing with people and telling them that they're wrong or (as you appear > to be doing) that they're old and out of touch isn't going to make them any > more likely to want to use your code. > You are totally wrong, I didn't it, especial called somebody "old". Perhaps you think like this beca

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-29 Thread Alvaro Herrera
I added an Assert(DatabasePath != NULL) to RelationCacheInitFilePreInvalidate() and didn't see a single crash when running the tests. I thought that adding a "VACUUM FREEZE pg_class" in the recovery tests (where there is a standby) ought to do it, but it doesn't. What's the deal there? Here are

POC: GROUP BY optimization

2018-05-29 Thread Teodor Sigaev
Hi! As far as I known, columns in GROUP BY could be reordered without loss of correctness. But reorder could give a benefits in performance. Suggested patch implements that in several ways: 1) Reorder GROUP BY columns by number of unique values in descent order. Simple example shows a perfor

pg_config.h.win32 missing a set of flags from pg_config.h.in added in v11 development

2018-05-29 Thread Michael Paquier
Hi all, While reviewing the MSVC code, I have noticed that pg_config.h.win32 is forgetting about a couple of flags defined in pg_config.h.in for v11 development. Forgetting some of them is problematic, and here are the ones I spotted: - HAVE_LDAP_INITIALIZE - HAVE_X509_GET_SIGNATURE_NID - HAVE_SS

Supporting tls-server-end-point as SCRAM channel binding for OpenSSL 1.0.0 and 1.0.1

2018-05-29 Thread Michael Paquier
Hi all, Currently, the SCRAM channel binding tls-server-end-point is supported only with OpenSSL 1.0.2 and newer versions as we rely on X509_get_signature_nid to get the certificate signature ID, which is the official way of upstream to get this information as all the contents of X509 are shadowed

Re: "column i.indnkeyatts does not exist" in pg_upgrade from 11dev to 11b1

2018-05-29 Thread Tom Lane
Justin Pryzby writes: > On Tue, May 29, 2018 at 02:00:20PM -0400, Tom Lane wrote: >> Yeah, that :-(. pg_dump's approach to cross-version catalog differences >> can only cope with differences between major versions. So if it sees >> a server that calls itself 11-something it's going to think that

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

2018-05-29 Thread Masahiko Sawada
On Mon, May 28, 2018 at 4:52 AM, Amit Kapila wrote: > Hi, > > Review comments on commit 857f9c36: > 1. > @@ -2049,6 +2055,10 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) > metapg = BufferGetPage(metabuf); > metad = BTPageGetMeta(metapg); > > + /* upgrade metapage if needed */ >

Re: behave of --create-slot option

2018-05-29 Thread Pavel Stehule
2018-05-29 16:53 GMT+02:00 Euler Taveira : > 2018-05-29 1:31 GMT-03:00 Pavel Stehule : > > I hope so I understand to motivation for this option - but I see issues: > > > > 1. pg_basebackup can fail from some other reasons, but there is not > special > > status for this issue. > > 2. when I use thi

Re: "column i.indnkeyatts does not exist" in pg_upgrade from 11dev to 11b1

2018-05-29 Thread Justin Pryzby
On Tue, May 29, 2018 at 02:00:20PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > I've used pg_upgrade like this before, but maybe from a different (recent) > > 11dev HEAD; I found: "pg_upgrade supports upgrades from 8.4.X and later to > > the > > current major release of PostgreSQL, includin

Re: plperl fails with perl 5.28

2018-05-29 Thread Christoph Berg
Re: Tom Lane 2018-05-23 <10366.1527109...@sss.pgh.pa.us> > > https://rt.perl.org/Public/Bug/Display.html?id=133220 > > Thanks. Looking at this again, it seems like the core of the problem > is that S_run_body's fell-off-the-end behavior is equivalent to an > explicit "exit(0)". Perhaps it should

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-29 Thread Andres Freund
On 2018-05-29 18:06:12 +, Nishant, Fnu wrote: > Hi, > > > To achieve this we can allocate Form_pg_class structures (for shared > > relations… a small number) on shared memory. > > But why would this be necessary / a good idea? Even if we decided it > were, it seems like it

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-29 Thread Nishant, Fnu
Hi, > To achieve this we can allocate Form_pg_class structures (for shared > relations… a small number) on shared memory. But why would this be necessary / a good idea? Even if we decided it were, it seems like it'd end up being quite invasive. But I doubt it's a good pla

Re: "column i.indnkeyatts does not exist" in pg_upgrade from 11dev to 11b1

2018-05-29 Thread Tom Lane
Justin Pryzby writes: > I've used pg_upgrade like this before, but maybe from a different (recent) > 11dev HEAD; I found: "pg_upgrade supports upgrades from 8.4.X and later to the > current major release of PostgreSQL, including snapshot and beta releases." > (But maybe upgrades FROM beta releases

Re: Avoiding Tablespace path collision for primary and standby

2018-05-29 Thread Ashwin Agrawal
On Sat, May 26, 2018 at 7:08 AM, Tom Lane wrote: > Thomas Munro writes: > > I also wondered about this when trying to figure out how to write a > > TAP test for recovery testing with tablespaces, for my undo proposal. > > I was starting to wonder about either allowing relative paths or > > suppo

Re: Add CONTRIBUTING.md

2018-05-29 Thread Andres Freund
On 2018-05-29 18:03:03 +0100, Andrew Gierth wrote: > > "Andres" == Andres Freund writes: > > Andres> Hi, > > Andres> A lot of people contribute in communities via github these > Andres> days. We should add a CONTRIBUTING.md that explains how to do > Andres> so, given that we don't use g

"column i.indnkeyatts does not exist" in pg_upgrade from 11dev to 11b1

2018-05-29 Thread Justin Pryzby
I've used pg_upgrade like this before, but maybe from a different (recent) 11dev HEAD; I found: "pg_upgrade supports upgrades from 8.4.X and later to the current major release of PostgreSQL, including snapshot and beta releases." (But maybe upgrades FROM beta releases aren't supported in the genera

Re: Add CONTRIBUTING.md

2018-05-29 Thread Andrew Gierth
> "Andres" == Andres Freund writes: Andres> Hi, Andres> A lot of people contribute in communities via github these Andres> days. We should add a CONTRIBUTING.md that explains how to do Andres> so, given that we don't use github. That's shown automatically Andres> when doing a pull requ

Re: Adding Markodwn formatting to psql output

2018-05-29 Thread Lætitia Avrot
Le mar. 29 mai 2018 à 17:28, Euler Taveira a écrit : > 2018-05-29 12:11 GMT-03:00 Lætitia Avrot : > > I write often documents for my customers in MarkDown to produce pdf > > documents. Quite often, I need to present data from queries in a tabular > > form. > > > > https://www.postgresql.org/messa

Re: Add CONTRIBUTING.md

2018-05-29 Thread Tatsuo Ishii
>> A lot of people contribute in communities via github these days. We >> should add a CONTRIBUTING.md that explains how to do so, given that we >> don't use github. That's shown automatically when doing a pull requests >> etc. >> >> I think it's also a good idea to have it in

Re: Add CONTRIBUTING.md

2018-05-29 Thread Joe Conway
On 05/29/2018 11:38 AM, Magnus Hagander wrote: > On Tue, May 29, 2018 at 5:36 PM, Andres Freund > wrote: > > Hi, > > A lot of people contribute in communities via github these days. We > should add a CONTRIBUTING.md that explains how to do so, given that we

Microoptimization of Bitmapset usage in postgres_fdw

2018-05-29 Thread Daniel Gustafsson
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 just that usecase, and (IMO) makes for clearer code. cheers ./danie

Re: Add CONTRIBUTING.md

2018-05-29 Thread Magnus Hagander
On Tue, May 29, 2018 at 5:36 PM, Andres Freund wrote: > Hi, > > A lot of people contribute in communities via github these days. We > should add a CONTRIBUTING.md that explains how to do so, given that we > don't use github. That's shown automatically when doing a pull requests > etc. > > I think

Add CONTRIBUTING.md

2018-05-29 Thread Andres Freund
Hi, A lot of people contribute in communities via github these days. We should add a CONTRIBUTING.md that explains how to do so, given that we don't use github. That's shown automatically when doing a pull requests etc. I think it's also a good idea to have it in the source tree independent of gi

Re: Adding Markodwn formatting to psql output

2018-05-29 Thread Euler Taveira
2018-05-29 12:11 GMT-03:00 Lætitia Avrot : > I write often documents for my customers in MarkDown to produce pdf > documents. Quite often, I need to present data from queries in a tabular > form. > https://www.postgresql.org/message-id/flat/CAAYBy8YU4pXYKDHeQhsA_=FC93yOBZp5j1h=bssao9-olcw...@mail.g

Adding Markodwn formatting to psql output

2018-05-29 Thread Lætitia Avrot
Hi, I write often documents for my customers in MarkDown to produce pdf documents. Quite often, I need to present data from queries in a tabular form. Psql output provides formatting in text (aligned and unaligned), HTML, latex, JSON (and so many more) but not in MarkDown. The aligned output is q

Re: behave of --create-slot option

2018-05-29 Thread Euler Taveira
2018-05-29 1:31 GMT-03:00 Pavel Stehule : > I hope so I understand to motivation for this option - but I see issues: > > 1. pg_basebackup can fail from some other reasons, but there is not special > status for this issue. > 2. when I use this option in any script, then I should to remove possibly >

Re: adding tab completions

2018-05-29 Thread David Fetter
On Tue, May 29, 2018 at 10:12:27AM -0400, Alvaro Herrera wrote: > Is it just me that finds shocking the notion of vacuuming a foreign > table? I guess it would be nice to have the ability to tab complete that, assuming it would actually do something at least potentially useful, but until then, you

Re: adding tab completions

2018-05-29 Thread Alvaro Herrera
Is it just me that finds shocking the notion of vacuuming a foreign table? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

PATCH pass PGOPTIONS to pg_regress

2018-05-29 Thread Manuel Kniep
Hi, attached patch passes PGOPTIONS env variable to pg_regress in pgxs.mk This is especially useful when developing extensions for different postgres versions where some session_variables might or might not exists. Consider something like this in an extensions makefile: ifeq ($(shell test $(VE

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

2018-05-29 Thread Alexander Korotkov
Hi! On Mon, May 28, 2018 at 11:52 AM, Amit Kapila wrote: > Review comments on commit 857f9c36: > 1. > @@ -2049,6 +2055,10 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) > metapg = BufferGetPage(metabuf); > metad = BTPageGetMeta(metapg); > > + /* upgrade metapage if needed */ >

Redundant psql tab-completion for CREATE PUBLICATION

2018-05-29 Thread Edmund Horner
Hi, While looking at Justin's patch for VACUUM completions, I found an existing bit of code that tries to match on a word with a space: /* Complete "CREATE PUBLICATION FOR TABLE " */ else if (Matches4("CREATE", "PUBLICATION", MatchAny, "FOR TABLE")) COMPLETE_WITH_SCHEMA_QUERY(Quer

Re: adding tab completions

2018-05-29 Thread Edmund Horner
On 29 May 2018 at 12:06, Justin Pryzby wrote: > Find attached tab completion for the following: > > "... Also, recursively perform VACUUM and ANALYZE on partitions when the > command is applied to a partitioned table." > 3c3bb99330aa9b4c2f6258bfa0265d806bf365c3 > > Add parenthesized options syntax

pgAgent: ERROR: Couldn't register event handle.

2018-05-29 Thread Arturas Mazeika
Hi PgSQL Hackers, I am overseeing a few hundred/thousand postgres/pgagent installations and on one installation the pgAgent does not start with a message as a service on a Windows Server: ERROR: Couldn't register event handle. once the service is being started. Investigation showed that this is

subscribe

2018-05-29 Thread Arturas Mazeika

Re: Is a modern build system acceptable for older platforms

2018-05-29 Thread Geoff Winkless
On Tue, 29 May 2018 at 11:42, Yuriy Zhuravlev wrote: > Is it worth spending thousands of person-hours converting what we have >> into something different that happens to be de rigeur, and (especially) >> using up many hours of our precious core developer time while they learn >> the new methods

Re: Is a modern build system acceptable for older platforms

2018-05-29 Thread Yuriy Zhuravlev
> > Is it worth spending thousands of person-hours converting what we have > into something different that happens to be de rigeur, and (especially) > using up many hours of our precious core developer time while they learn > the new methods, while not actually gaining functionality? Also, probab

Re: Is a modern build system acceptable for older platforms

2018-05-29 Thread Geoff Winkless
On Mon, 28 May 2018 at 03:30, Yuriy Zhuravlev wrote: > I suppose I can make summary after reading all this: > 1. Any change in the development process will be possible if it will be > convenient for each key developers personally only. (development process > include build system) > 2. Currently,

Re: adding tab completions

2018-05-29 Thread Arthur Zakirov
Hello, On Mon, May 28, 2018 at 07:06:23PM -0500, Justin Pryzby wrote: > Find attached tab completion for the following: The patch works well. I have a couple notes. The patch replaces the variable Query_for_list_of_tmf by Query_for_list_of_tpmf. So I think Query_for_list_of_tmf isn't needed anym

Re: Postgres, fsync, and OSs (specifically linux)

2018-05-29 Thread Craig Ringer
On 21 May 2018 at 15:50, Craig Ringer wrote: > On 21 May 2018 at 12:57, Craig Ringer wrote: > >> On 18 May 2018 at 00:44, Andres Freund wrote: >> >>> Hi, >>> >>> On 2018-05-10 09:50:03 +0800, Craig Ringer wrote: >>> > while ((src = (RewriteMappingFile *) >>> hash_seq_search(&seq_status))