[HACKERS] Re: [COMMITTERS] pgsql: Retain comments on indexes and constraints at ALTER TABLE ... TY

2015-07-20 Thread Heikki Linnakangas
On 07/18/2015 04:15 PM, Alvaro Herrera wrote: Heikki Linnakangas wrote: If it's there just to so you can run the regression tests that come with it, it might make sense to just add a default case to that switch to handle any unrecognized commands, and perhaps even remove the cases for the

Re: [HACKERS] Support for N synchronous standby servers - take 2

2015-07-20 Thread Simon Riggs
On 20 July 2015 at 08:18, Beena Emerson memissemer...@gmail.com wrote: Simon Riggs wrote: synchronous_standby_name= is already 25 characters, so that leaves 115 characters - are they always single byte chars? I am sorry, I did not get why there is a 140 byte limit. Can you please explain?

Re: [HACKERS] postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)

2015-07-20 Thread Ashutosh Bapat
Hi Hanada-san, I have reviewed usermapping patch and here are some comments. The patch applies cleanly on Head and compiles without problem. The make check in regression folder does not show any failure. In find_user_mapping(), if the first cache search returns a valid tuple, it is checked twice

Re: [HACKERS] Support for N synchronous standby servers - take 2

2015-07-20 Thread Beena Emerson
Simon Riggs wrote: synchronous_standby_name= is already 25 characters, so that leaves 115 characters - are they always single byte chars? I am sorry, I did not get why there is a 140 byte limit. Can you please explain? - Beena Emerson -- View this message in context:

Re: [HACKERS] [PATCH] pg_upgrade fails when postgres/template1 isn't in default tablespace

2015-07-20 Thread Marti Raudsepp
On Mon, Jun 22, 2015 at 9:20 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Jun 19, 2015 at 12:10 PM, Marti Raudsepp ma...@juffo.org wrote: One of my databases failed to upgrade successfully and produced this error in the copying phase: error while copying relation

Re: [HACKERS] Parallel Seq Scan

2015-07-20 Thread Haribabu Kommi
On Mon, Jul 20, 2015 at 3:31 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Jul 17, 2015 at 1:22 PM, Haribabu Kommi kommi.harib...@gmail.com wrote: On Thu, Jul 16, 2015 at 1:10 PM, Amit Kapila amit.kapil...@gmail.com wrote: Thanks, I will fix this in next version of patch. I am

[HACKERS] All-zero page in GIN index causes assertion failure

2015-07-20 Thread Heikki Linnakangas
This is a continuation of the discussion at http://www.postgresql.org/message-id/CAMkU=1zUc=h0oczntajaqqw7gxxvxcwsyq8dd2t7ohgsgve...@mail.gmail.com, I'm starting a new thread as this is a separate issue than the original LWLock bug. On Thu, Jul 16, 2015 at 12:03 AM, Jeff Janes

Re: [HACKERS] TABLESAMPLE patch is really in pretty sad shape

2015-07-20 Thread Petr Jelinek
On 2015-07-19 22:56, Tom Lane wrote: Since I'm not observing any movement on the key question of redesigning the tablesample method API, and I think that's something that's absolutely necessary to fix for 9.5, attached is an attempt to respecify the API. Sorry, I got something similar to what

Re: [HACKERS] Implementation of global temporary tables?

2015-07-20 Thread Andres Freund
On 2015-07-20 15:33:32 +1200, Gavin Flower wrote: Would it be difficult to add the ability for one user to share the contents with a list of named other users (roles)? No need. That feature is called unlogged tables and grants. Doing this for temporary tables would be horrible. They live in

Re: [HACKERS] Re: [COMMITTERS] pgsql: Retain comments on indexes and constraints at ALTER TABLE ... TY

2015-07-20 Thread Andres Freund
On 2015-07-17 21:40:45 +0300, Heikki Linnakangas wrote: Hmm, that function is pretty fragile, it will segfault on any AT_* type that it doesn't recognize. Thankfully you get that compiler warning, but we have added AT_* type codes before in minor releases. For in-core code that is supposed to

Re: [HACKERS] object_classes array is broken, again

2015-07-20 Thread Alvaro Herrera
Any opinions on this idea? I don't like it all that much, but it's plenty effective. Alvaro Herrera wrote: The problem is that there aren't enough callers of add_object_address: there are many indexes of that array that aren't ever accessed and so it's not obvious when the array is broken.

[HACKERS] Re: [COMMITTERS] pgsql: Retain comments on indexes and constraints at ALTER TABLE ... TY

2015-07-20 Thread Alvaro Herrera
Heikki Linnakangas wrote: On 07/18/2015 04:15 PM, Alvaro Herrera wrote: Heikki Linnakangas wrote: If it's there just to so you can run the regression tests that come with it, it might make sense to just add a default case to that switch to handle any unrecognized commands, and perhaps even

Re: [HACKERS] Re: [COMMITTERS] pgsql: Retain comments on indexes and constraints at ALTER TABLE ... TY

2015-07-20 Thread Alvaro Herrera
Alvaro Herrera wrote: Heikki Linnakangas wrote: On 07/18/2015 04:15 PM, Alvaro Herrera wrote: Heikki Linnakangas wrote: If it's there just to so you can run the regression tests that come with it, it might make sense to just add a default case to that switch to handle any unrecognized

Re: [HACKERS] Grouping Sets: Fix unrecognized node type bug

2015-07-20 Thread Jeevan Chalke
On Sat, Jul 18, 2015 at 12:27 AM, Andrew Gierth and...@tao11.riddles.org.uk wrote: Kyotaro == Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: Kyotaro Hello, this looks to be a kind of thinko. The attached patch Kyotaro fixes it. No, that's still wrong. Just knowing that there

Re: [HACKERS] [PROPOSAL] VACUUM Progress Checker.

2015-07-20 Thread Thakur, Sameer
Hello, Does this actually handle multiple indexes? It doesn't appear so, which I'd think is a significant problem... :/ Please find v2 attached which does this. I'm also not seeing how this will deal with exhausting maintenance_work_mem. ISTM that when that happens you'd definitely want a better

Re: [HACKERS] Implementation of global temporary tables?

2015-07-20 Thread Alvaro Herrera
Pavel Stehule wrote: 2015-07-20 5:33 GMT+02:00 Gavin Flower gavinflo...@archidevsys.co.nz: Would it be difficult to add the ability for one user to share the contents with a list of named other users (roles)? Probably it is possible, but not for temporary data - short data are in

Re: [HACKERS] Implementation of global temporary tables?

2015-07-20 Thread Pavel Stehule
2015-07-20 11:07 GMT+02:00 Alvaro Herrera alvhe...@2ndquadrant.com: Pavel Stehule wrote: 2015-07-20 5:33 GMT+02:00 Gavin Flower gavinflo...@archidevsys.co.nz: Would it be difficult to add the ability for one user to share the contents with a list of named other users (roles)?

Re: [HACKERS] [COMMITTERS] pgsql: Improve BRIN documentation somewhat

2015-07-20 Thread Alvaro Herrera
Alvaro Herrera wrote: Improve BRIN documentation somewhat This removes some info about support procedures being used, which was obsoleted by commit db5f98ab4f, as well as add some more documentation on how to create new opclasses using the Minmax infrastructure. (Hopefully we can get

Re: [HACKERS] TABLESAMPLE patch is really in pretty sad shape

2015-07-20 Thread Petr Jelinek
On 2015-07-20 12:18, Petr Jelinek wrote: On 2015-07-19 22:56, Tom Lane wrote: * You might have expected me to move the tsmseqscan and tsmpagemode flags into the TsmRoutine struct, but instead this API puts equivalent flags into the SampleScanState struct. The reason for that is that it lets

[HACKERS] Use pg_rewind when target timeline was switched

2015-07-20 Thread Alexander Korotkov
Hackers, attached patch allows pg_rewind to work when target timeline was switched. Actually, this patch fixes TODO from pg_rewind comments. /* * Trace the history backwards, until we hit the target timeline. * * TODO: This assumes that there are no timeline switches on the target

Re: [HACKERS] Implementation of global temporary tables?

2015-07-20 Thread Zhaomo Yang
Just to be clear, the idea of a global temp table is that the table def is available to all users, but the data is private to each session? The table def is visible to all sessions and persistent, but the data is private to each session and temporary. Thanks, Zhaomo

Re: [HACKERS] creating extension including dependencies

2015-07-20 Thread Petr Jelinek
On 2015-07-19 17:16, Michael Paquier wrote: On Sat, Jul 18, 2015 at 8:00 AM, Petr Jelinek p...@2ndquadrant.com wrote: On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: On July 10, 2015

Re: [HACKERS] [PATCH] pg_upgrade fails when postgres/template1 isn't in default tablespace

2015-07-20 Thread Michael Paquier
On Mon, Jul 20, 2015 at 4:31 PM, Marti Raudsepp ma...@juffo.org wrote: On Mon, Jun 22, 2015 at 9:20 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Jun 19, 2015 at 12:10 PM, Marti Raudsepp ma...@juffo.org wrote: One of my databases failed to upgrade successfully and produced this error in

Re: [HACKERS] Support for N synchronous standby servers - take 2

2015-07-20 Thread Beena Emerson
Simon Riggs wrote: The choice between formats is not solely predicated on whether we have multi-line support. I still think writing down some actual use cases would help bring the discussion to a conclusion. Inventing a general facility is hard without some clear goals about what we need to

Re: [HACKERS] patch: enhanced DROP POLICY tab complete

2015-07-20 Thread Alvaro Herrera
Pavel Stehule wrote: Hi I am sending trivial patch, that enforce more precious tab complete for DROP POLICY statement Thanks, pushed and preciousified. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training Services --

Re: [HACKERS] First Aggregate Funtion?

2015-07-20 Thread sudalai
I don't think so, because arrays can contain duplicates. I just add two element to the array. One for INITCOND value NULL, second for first row value. So Array size is always 2. So no duplicates. rhaas=# select coalesce(first(x.column1), 'wrong') from (values (null), ('correct')) x;

Re: [BUGS] [HACKERS] object_classes array is broken, again

2015-07-20 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Any opinions on this idea? I don't like it all that much, but it's plenty effective. I don't like it much either. What about adding StaticAsserts that lengthof() the relevant constant arrays is equal to MAX_OCLASS? (Or other similar ways of

Re: [HACKERS] All-zero page in GIN index causes assertion failure

2015-07-20 Thread Heikki Linnakangas
On 07/20/2015 11:14 AM, Heikki Linnakangas wrote: ISTM ginvacuumcleanup should check for PageIsNew, and put the page to the FSM. That's what btvacuumpage() gistvacuumcleanup() do. spgvacuumpage() seems to also check for PageIsNew(), but it seems broken in a different way: it initializes the page

Re: [HACKERS] pg_trgm version 1.2

2015-07-20 Thread Alexander Korotkov
On Wed, Jul 15, 2015 at 12:31 AM, Jeff Janes jeff.ja...@gmail.com wrote: On Tue, Jul 7, 2015 at 6:33 AM, Alexander Korotkov a.korot...@postgrespro.ru wrote: See Tom Lane's comment about downgrade scripts. I think just remove it is a right solution. The new patch removes the downgrade

Re: [HACKERS] First Aggregate Funtion?

2015-07-20 Thread Merlin Moncure
On Mon, Jul 20, 2015 at 8:40 AM, sudalai sudala...@gmail.com wrote: I don't think so, because arrays can contain duplicates. I just add two element to the array. One for INITCOND value NULL, second for first row value. So Array size is always 2. So no duplicates. rhaas=# select

Re: [HACKERS] First Aggregate Funtion?

2015-07-20 Thread Paul A Jungwirth
The above implementation of first aggregate returns the first non-NULL item value. I'm curious what advantages this approach has over these FIRST/LAST functions from the Wiki?: https://wiki.postgresql.org/wiki/First/last_%28aggregate%29 Also to get the first non-null value you can apply

Re: [HACKERS] All-zero page in GIN index causes assertion failure

2015-07-20 Thread Alvaro Herrera
Heikki Linnakangas wrote: Looking closer, heap vacuum does a similar thing, but there are two mitigating factors that make it safe in practice, I think: 1. An empty heap page is all-zeroes except for the small page header in the beginning of the page. For a torn page to matter, the page

Re: [HACKERS] Dead code in Create/RenameRole() after RoleSpec changes related to CURRENT/SESSION_USER

2015-07-20 Thread Alvaro Herrera
Jeevan Chalke wrote: I found some dead code in CREATE/RENAME ROLE code path. We have introduced RoleSpec and handled public and none role names in grammar itself. We do have these handling in CreateRole() and RenameRole() which is NO more valid now. Right. Attached patch to remove

Re: [HACKERS] First Aggregate Funtion?

2015-07-20 Thread Merlin Moncure
On Mon, Jul 20, 2015 at 10:06 AM, Paul A Jungwirth p...@illuminatedcomputing.com wrote: The above implementation of first aggregate returns the first non-NULL item value. I'm curious what advantages this approach has over these FIRST/LAST functions from the Wiki?:

Re: [BUGS] [HACKERS] object_classes array is broken, again

2015-07-20 Thread Tom Lane
I wrote: +1 to this patch, in fact I think we could remove MAX_OCLASS altogether which would be very nice for switch purposes. Oh, wait, I forgot that the patch itself introduces another reference to MAX_OCLASS. I wonder though if we should get rid of that as an enum value in favor of

Re: [HACKERS] First Aggregate Funtion?

2015-07-20 Thread Marko Tiikkaja
On 7/20/15 6:02 PM, Corey Huinker wrote: By using only(a.name_of_the_thing) we'd have a bit more clarity that the author expected all of those values to be the same across the aggregate window, and discovering otherwise was reason enough to fail the query. *IF* we're considering adding these to

Re: [HACKERS] Typo in comment in setrefs.c

2015-07-20 Thread Alvaro Herrera
Etsuro Fujita wrote: I ran into a typo in a comment in setrefs.c. Patch attached. Fixed by Heikki in 7845db2aa. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training Services -- Sent via pgsql-hackers mailing list

Re: [HACKERS] TABLESAMPLE patch is really in pretty sad shape

2015-07-20 Thread Emre Hasegeli
to handle DROP dependency behaviors properly. (On reflection, maybe better if it's bernoulli(internal) returns tablesample_handler, so as to guarantee that such a function doesn't create a conflict with any user-defined function of the same name.) The probability of conflict seems high with

Re: [BUGS] [HACKERS] object_classes array is broken, again

2015-07-20 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: What about adding StaticAsserts that lengthof() the relevant constant arrays is equal to MAX_OCLASS? (Or other similar ways of checking that they have the right number of entries.) Well, the array itself is declared like this:

Re: [HACKERS] patch: enhanced DROP POLICY tab complete

2015-07-20 Thread Pavel Stehule
Thank you very much Pavel 2015-07-20 15:39 GMT+02:00 Alvaro Herrera alvhe...@2ndquadrant.com: Pavel Stehule wrote: Hi I am sending trivial patch, that enforce more precious tab complete for DROP POLICY statement Thanks, pushed and preciousified. -- Álvaro Herrera

Re: [HACKERS] First Aggregate Funtion?

2015-07-20 Thread Corey Huinker
On Mon, Jul 20, 2015 at 11:06 AM, Paul A Jungwirth p...@illuminatedcomputing.com wrote: The above implementation of first aggregate returns the first non-NULL item value. I'm curious what advantages this approach has over these FIRST/LAST functions from the Wiki?:

Re: [BUGS] [HACKERS] object_classes array is broken, again

2015-07-20 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: Any opinions on this idea? I don't like it all that much, but it's plenty effective. I don't like it much either. What about adding StaticAsserts that lengthof() the relevant constant arrays is equal to MAX_OCLASS? (Or

Re: [HACKERS] make check changes have caused buildfarm deterioration.

2015-07-20 Thread Tom Lane
Andrew Dunstan andrew.duns...@pgexperts.com writes: Somewhere along the way some changes to the way we do make check have caused a significant deterioration in the buildfarm's logging. Compare these two from animal crake, which happens to be my test instance:

Re: [HACKERS] Unnecessary #include in objectaddress.h?

2015-07-20 Thread Alvaro Herrera
Adam Brightwell wrote: All, While looking at the include dependency graph for objectaddress.h: http://doxygen.postgresql.org/objectaddress_8h.html I saw that pg_list.h is both included and inherited (through multiple paths) by objectaddress.h. Perhaps this doesn't matter, but I thought

Re: [HACKERS] TABLESAMPLE patch is really in pretty sad shape

2015-07-20 Thread Tom Lane
Petr Jelinek p...@2ndquadrant.com writes: On 2015-07-19 22:56, Tom Lane wrote: * I specified that omitting NextSampleBlock is allowed and causes the core code to do a standard seqscan, including syncscan support, which is a behavior that's impossible with the current API. If we fix the

Re: [HACKERS] creating extension including dependencies

2015-07-20 Thread Michael Paquier
On Mon, Jul 20, 2015 at 10:20 PM, Petr Jelinek p...@2ndquadrant.com wrote: On 2015-07-19 17:16, Michael Paquier wrote: On Sat, Jul 18, 2015 at 8:00 AM, Petr Jelinek p...@2ndquadrant.com wrote: On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane

Re: [HACKERS] security labels on databases are bad for dump restore

2015-07-20 Thread Adam Brightwell
Consistency with existing practice would indeed have pg_dump ignore pg_shseclabel and have pg_dumpall reproduce its entries. I think that makes sense, but what about other DATABASE level info such as COMMENT? Should that also be ignored by pg_dump as well? I'm specifically thinking of the

Re: [HACKERS] Unnecessary #include in objectaddress.h?

2015-07-20 Thread Adam Brightwell
I wondered whether to bother about this kind of thing for a while. It doesn't have any practical impact immediately, because obviously pg_list.h is still included indirectly by objectaddress.h (via lock.h in this case IIRC). If we made some restructuring that caused the other header not to

Re: [HACKERS] A little RLS oversight?

2015-07-20 Thread Michael Paquier
On Tue, Jul 14, 2015 at 4:01 AM, Stephen Frost sfr...@snowman.net wrote: Michael, * Michael Paquier (michael.paqu...@gmail.com) wrote: On Sun, Jul 12, 2015 at 5:59 PM, Yaroslav wrote: I can still see all statistics for 'test' in pg_stats under unprivileged user. Indeed, this looks like

Re: [HACKERS] make check changes have caused buildfarm deterioration.

2015-07-20 Thread Michael Paquier
On Tue, Jul 21, 2015 at 2:39 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Tue, Jul 21, 2015 at 6:17 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andrew Dunstan andrew.duns...@pgexperts.com writes: Somewhere along the way some changes to the way we do make check have caused a significant

Re: [HACKERS] make check changes have caused buildfarm deterioration.

2015-07-20 Thread Michael Paquier
On Tue, Jul 21, 2015 at 6:17 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andrew Dunstan andrew.duns...@pgexperts.com writes: Somewhere along the way some changes to the way we do make check have caused a significant deterioration in the buildfarm's logging. Compare these two from animal crake,