Re: [HACKERS] UPDATE of partition key

2017-05-02 Thread Amit Khandekar
On 2 May 2017 at 18:17, Robert Haas wrote: > On Tue, Apr 4, 2017 at 7:11 AM, Amit Khandekar wrote: >> Attached updated patch v7 has the above changes. > > This no longer applies. Please rebase. Thanks Robert for informing about this. My patch has

Re: [HACKERS] Re: [BUGS] BUG #14634: On Windows pg_basebackup should write tar to stdout in binary mode

2017-05-02 Thread Craig Ringer
On 3 May 2017 at 12:32, Haribabu Kommi wrote: > [Adding -hackers mailing list] > > On Fri, Apr 28, 2017 at 6:28 PM, wrote: >> >> The following bug has been logged on the website: >> >> Bug reference: 14634 >> Logged by: Henry

Re: [HACKERS] CTE inlining

2017-05-02 Thread Craig Ringer
On 3 May 2017 at 07:00, Tomas Vondra wrote: > I'm not sure what you mean by "jerking this out from users". Isn't most of > this thread about how to allow CTE inlining without hurting users > unnecessarily? He's referring to Andreas Karlsson

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 18:25, Alvaro Herrera wrote: > Petr Jelinek wrote: >> On 02/05/17 18:00, Robert Haas wrote: >>> On Tue, May 2, 2017 at 11:49 AM, Alvaro Herrera >>> wrote: Petr Jelinek wrote: > So the only way to fulfill the requirement you stated is to just not try

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 22:40, Robert Haas wrote: > On Tue, May 2, 2017 at 3:02 PM, Petr Jelinek > wrote: >> That sounds okay. I know PeterE didn't like the lower case and >> underscore separated words for options in the original patch, so I'd >> like to hear his opinion on

[HACKERS] Re: [BUGS] BUG #14634: On Windows pg_basebackup should write tar to stdout in binary mode

2017-05-02 Thread Haribabu Kommi
[Adding -hackers mailing list] On Fri, Apr 28, 2017 at 6:28 PM, wrote: > The following bug has been logged on the website: > > Bug reference: 14634 > Logged by: Henry Boehlert > Email address: henry_boehl...@agilent.com > PostgreSQL version: 9.6.2

Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table

2017-05-02 Thread Stephen Frost
Amit, * Amit Langote (langote_amit...@lab.ntt.co.jp) wrote: > Attached updated patches. Please find an updated version which corrects the issue with binary-upgrade of partitioned tables having partitions in other schemas, along with a few other minor improvements. If you could take a look at

Re: [HACKERS] check with serial

2017-05-02 Thread Vaishnavi Prabakaran
On Tue, May 2, 2017 at 11:30 PM, Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > Here's a simple patch that does what I had in mind. It allows providing > for an arbitrary schedule file in both the check and installcheck > recipes. The historic behaviour is preserved. > > Hmm,

Re: [HACKERS] renaming "transaction log"

2017-05-02 Thread Stephen Frost
Peter, * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > Most documentation and error messages still uses the term "transaction > log" to refer to the write-ahead log. Here is a patch to rename that, > which I think should be done, to match the xlog -> wal renaming in APIs. Haven't

Re: [HACKERS] [POC] hash partitioning

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 9:01 PM, Jeff Davis wrote: > On Tue, Feb 28, 2017 at 6:33 AM, Yugo Nagata wrote: >> In this patch, user can specify a hash function USING. However, >> we migth need default hash functions which are useful and >> proper for hash

Re: [HACKERS] SUBSCRIPTIONS and pg_upgrade

2017-05-02 Thread Noah Misch
On Thu, Apr 13, 2017 at 12:11:30PM -0400, Robert Haas wrote: > On Thu, Apr 13, 2017 at 12:05 PM, Peter Eisentraut > wrote: > > On 4/12/17 18:31, Peter Eisentraut wrote: > >> On 4/11/17 23:41, Noah Misch wrote: > >>> On Tue, Apr 11, 2017 at 11:21:24PM -0400, Peter

Re: [HACKERS] transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)

2017-05-02 Thread Thomas Munro
On Tue, May 2, 2017 at 3:01 AM, Robert Haas wrote: > [...] > Only the rows in the parent show up in the transition table. But now > look what happens if I add an unrelated trigger that also uses > transition tables to the children: > > rhaas=# CREATE FUNCTION u() RETURNS

[HACKERS] renaming "transaction log"

2017-05-02 Thread Peter Eisentraut
Most documentation and error messages still uses the term "transaction log" to refer to the write-ahead log. Here is a patch to rename that, which I think should be done, to match the xlog -> wal renaming in APIs. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL

Re: [HACKERS] Bug in prepared statement cache invalidation?

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 5:50 PM, Tom Lane wrote: > Robert Haas writes: >> Yeah. I think there should be a way to tell a PL to flush any >> internal caches it is maintaining, some variant of DISCARD. But that >> would require a bunch of code that

Re: [HACKERS] [POC] hash partitioning

2017-05-02 Thread Jeff Davis
On Tue, Feb 28, 2017 at 6:33 AM, Yugo Nagata wrote: > In this patch, user can specify a hash function USING. However, > we migth need default hash functions which are useful and > proper for hash partitioning. I suggest that we consider the hash functions more carefully.

Re: [HACKERS] Transition tables for triggers on foreign tables and views

2017-05-02 Thread Kevin Grittner
On Fri, Apr 28, 2017 at 10:56 PM, Tom Lane wrote: > They will fire if you have an INSTEAD OF row-level trigger; the existence > of that trigger is what determines whether we implement DML on a view > through the view's own triggers or through translation to an action on > the

Re: [HACKERS] CTE inlining

2017-05-02 Thread Tomas Vondra
On 5/2/17 11:23 PM, Merlin Moncure wrote: \On Tue, May 2, 2017 at 12:05 PM, Tomas Vondra wrote: On 5/2/17 6:34 PM, David Fetter wrote: On Tue, May 02, 2017 at 02:40:55PM +0200, Andreas Karlsson wrote: On 05/02/2017 04:38 AM, Craig Ringer wrote: On 1 May

Re: [HACKERS] Shared Memory hash tables only at startup

2017-05-02 Thread Thomas Munro
On Tue, May 2, 2017 at 11:54 PM, hariprasath nallasamy wrote: > Hi > It is clear that all of the shared memory hash tables are created during > startup using ShmemInitHash() > > (In practice, all creations are done in the postmaster > process; child processes

Re: [HACKERS] changing mvstats output to be valid JSON

2017-05-02 Thread Alvaro Herrera
Alvaro Herrera wrote: > While writing the recent ext.stats docs, I became annoyed by the output > functions of the new types used by multivariate statistics: they are > almost JSON, but not quite. Since they can become largish, I propose > that we make a point of ensuring the output of those

Re: [HACKERS] Bug in prepared statement cache invalidation?

2017-05-02 Thread Tom Lane
Robert Haas writes: > Yeah. I think there should be a way to tell a PL to flush any > internal caches it is maintaining, some variant of DISCARD. But that > would require a bunch of code that nobody's written yet. That mechanism already exists, so far as the core code is

Re: [HACKERS] Bug in prepared statement cache invalidation?

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 3:10 PM, Konstantin Knizhnik wrote: > On 05/02/2017 09:30 PM, Robert Haas wrote: >>> I am not sure how critical is this problem. Definitely it rarely happens, >>> but lack of normal workarounds (restart backend, recreate function?) >>> seems >>>

Re: [HACKERS] multi-column range partition constraint

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 2:51 AM, Amit Langote wrote: > Per an off-list report from Olaf Gawenda (thanks Olaf), it seems that the > range partition's constraint is sometimes incorrect, at least in the case > of multi-column range partitioning. See below: > > create

Re: [HACKERS] Row Level Security UPDATE Confusion

2017-05-02 Thread Stephen Frost
Robert, * Robert Haas (robertmh...@gmail.com) wrote: > On Fri, Apr 14, 2017 at 9:16 AM, Stephen Frost wrote: > > I agreed already up-thread that there's an issue there and will be > > looking to fix it. That comment was simply replying to Rod's point that > > the

Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table

2017-05-02 Thread Stephen Frost
Amit, * Amit Langote (langote_amit...@lab.ntt.co.jp) wrote: > Now that WITH OPTIONS is optional even for CREATE TABLE OF, perhaps it > needs to be mentioned in the release notes? Doesn't strike me as rising to the level of needing to go into the release notes, but I won't object if people feel

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 5:15 PM, Alvaro Herrera wrote: > Robert Haas wrote: >> On Tue, May 2, 2017 at 12:25 PM, Alvaro Herrera >> wrote: >> > 2) don't drop because we know it won't work. I see two options: >> >c) ignore a drop slot failure,

Re: [HACKERS] [GENERAL] Column rename in an extension update script

2017-05-02 Thread Tom Lane
Julien Rouhaud writes: > moving this thread to -hackers, since this looks like a bug. > On 01/05/2017 08:54, Philippe BEAUDOIN wrote: >> I am coding an update script for an extension. And I am in trouble when >> trying to rename a column of an existing table. >> >>

Re: [HACKERS] CTE inlining

2017-05-02 Thread Merlin Moncure
\On Tue, May 2, 2017 at 12:05 PM, Tomas Vondra wrote: > On 5/2/17 6:34 PM, David Fetter wrote: >> >> On Tue, May 02, 2017 at 02:40:55PM +0200, Andreas Karlsson wrote: >>> >>> On 05/02/2017 04:38 AM, Craig Ringer wrote: On 1 May 2017 at 22:26, Andreas

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Alvaro Herrera
Robert Haas wrote: > On Tue, May 2, 2017 at 12:25 PM, Alvaro Herrera > wrote: > > 2) don't drop because we know it won't work. I see two options: > >c) ignore a drop slot failure, i.e. don't cause a transaction abort. > > An easy way to implement this is just

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 3:02 PM, Petr Jelinek wrote: > That sounds okay. I know PeterE didn't like the lower case and > underscore separated words for options in the original patch, so I'd > like to hear his opinion on this. I am not sure how much advantage is > there

Re: [HACKERS] [GENERAL] Column rename in an extension update script

2017-05-02 Thread Julien Rouhaud
moving this thread to -hackers, since this looks like a bug. On 01/05/2017 08:54, Philippe BEAUDOIN wrote: > Hi all, > > I am coding an update script for an extension. And I am in trouble when > trying to rename a column of an existing table. > > Just after the ALTER TABLE statement, I want to

Re: [HACKERS] Row Level Security UPDATE Confusion

2017-05-02 Thread Robert Haas
On Fri, Apr 14, 2017 at 9:16 AM, Stephen Frost wrote: > I agreed already up-thread that there's an issue there and will be > looking to fix it. That comment was simply replying to Rod's point that > the documentation could also be improved. OK, thanks. The wrap for the next

Re: [HACKERS] modeling parallel contention (was: Parallel Append implementation)

2017-05-02 Thread Robert Haas
On Tue, Apr 18, 2017 at 2:48 AM, Amit Khandekar wrote: > After searching through earlier mails about parallel scan, I am not > sure whether the shared state was considered to be a potential factor > that might reduce parallel query gains, when deciding the calculation >

Re: [HACKERS] Bug in prepared statement cache invalidation?

2017-05-02 Thread Konstantin Knizhnik
On 05/02/2017 09:30 PM, Robert Haas wrote: I am not sure how critical is this problem. Definitely it rarely happens, but lack of normal workarounds (restart backend, recreate function?) seems to be disappointing. The problem goes away if you reconnect. The problematic cache is only

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 19:42, Robert Haas wrote: > On Tue, May 2, 2017 at 8:45 AM, Petr Jelinek > wrote: >> I am happy to implement something different, it's quite trivial to >> change. But I am not going to propose anything different as I can't >> think of better syntax (if I

Re: [HACKERS] SCRAM authentication, take three

2017-05-02 Thread Heikki Linnakangas
On 05/02/2017 09:57 PM, Robert Haas wrote: Does db_user_namespace work with SCRAM? Yes. Haven't tested it, come to think of it, but it should work. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Ongoing issues with representation of empty arrays

2017-05-02 Thread Robert Haas
On Tue, Apr 11, 2017 at 12:17 AM, Andrew Gierth wrote: >> "Tom" == Tom Lane writes: > > >> First is contrib/intarray, _AGAIN_ (see past bugs such as #7730): > >> ... > >> I plan to fix this one properly, unless anyone has any objections. >

Re: [HACKERS] SCRAM authentication, take three

2017-05-02 Thread Robert Haas
On Tue, Apr 18, 2017 at 7:58 AM, Magnus Hagander wrote: >> Yeah, that would be reasonable. It can't be called just "password", >> though, because there's no way to implement "password-or-md5-or-scram" in a >> sensible way (see my reply to Simon at [1]). Unless we remove the

Re: [HACKERS] Typos in comments in partition.c

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 5:58 AM, Etsuro Fujita wrote: > I ran into typos in comments in RelationGetPartitionDispatchInfo() in > partition.c. Here is a small patch for: s/all the leaf partition/all the > leaf partitions/ and s/we we/we/. Committed. -- Robert Haas

Re: [HACKERS] Logical replication - TRAP: FailedAssertion in pgstat.c

2017-05-02 Thread Robert Haas
On Thu, Apr 20, 2017 at 2:58 PM, Peter Eisentraut wrote: > On 4/16/17 16:11, Petr Jelinek wrote: >> Yeah it is, it needs to be fenced to happen only after commit, which is >> not guaranteed at the point of code, we probably need to put the >> pgstat_report_stat()

Re: [HACKERS] Bug in prepared statement cache invalidation?

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 6:07 AM, Konstantin Knizhnik wrote: > Thank you for explanation. > May be I am missing something, but what is the problem with keeping > dependencies for PL functions? > As you wrote, PL can inform core that functions depends on some set of >

Re: [HACKERS] Cached plans and statement generalization

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 5:50 AM, Konstantin Knizhnik wrote: >> I don't see something with a bunch of hard-coded rules for particular type >> OIDs having any chance of being acceptable. > > Well, what I need is ... Regarding this... > Definitely copying of code is bad

Re: [HACKERS] Declarative partitioning - another take

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 3:30 AM, Amit Langote wrote: > You're right. I agree that whatever text we add here should be pointing > out that statement-level triggers of affected child tables are not fired, > when root parent is specified in the command. > > Since there

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 8:45 AM, Petr Jelinek wrote: > I am happy to implement something different, it's quite trivial to > change. But I am not going to propose anything different as I can't > think of better syntax (if I could I would have done it). I don't like >

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 12:25 PM, Alvaro Herrera wrote: > 2) don't drop because we know it won't work. I see two options: >c) ignore a drop slot failure, i.e. don't cause a transaction abort. > An easy way to implement this is just add a PG_TRY block, but we >

Re: [HACKERS] Potential hot-standby bug around xacts committed but in xl_running_xacts

2017-05-02 Thread Simon Riggs
On 2 May 2017 at 18:06, Andres Freund wrote: >> What I suggest is that with logical decoding in mind we do this >> 1. Inject a new record XLOG_SNAPSHOT_START at the start of >> LogStandbySnapshot(). We start logical decoding from there. >> 2. Record any transactions that end

Re: [HACKERS] CTE inlining

2017-05-02 Thread Tomas Vondra
On 5/2/17 6:34 PM, David Fetter wrote: On Tue, May 02, 2017 at 02:40:55PM +0200, Andreas Karlsson wrote: On 05/02/2017 04:38 AM, Craig Ringer wrote: On 1 May 2017 at 22:26, Andreas Karlsson wrote: >> ... I see some alternatives, none of them perfect. 1. Just remove the

Re: [HACKERS] CTE inlining

2017-05-02 Thread Corey Huinker
> > I get that people with gigantic PostgreSQL installations with > stringent performance requirements sometimes need to do odd things to > squeeze out the last few percentage points of performance. As the > people (well, at least the people close to the ground) at these > organizations are fully

Re: [HACKERS] scram and \password

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 3:42 AM, Heikki Linnakangas wrote: > There's going to be a default, one way or another. The default is going to > come from password_encryption, or it's going to be a hard-coded value or > logic based on server-version in PQencryptPasswordConn(). Or it's

Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range

2017-05-02 Thread Vladimir Borodin
Hi. > 25 апр. 2017 г., в 18:13, Dmitriy Sarafannikov > написал(а): > > I'd like to propose to search min and max value in index with SnapshotAny in > get_actual_variable_range function. > Current implementation scans index with SnapshotDirty which accepts >

Re: [HACKERS] CTE inlining

2017-05-02 Thread David Fetter
On Tue, May 02, 2017 at 02:40:55PM +0200, Andreas Karlsson wrote: > On 05/02/2017 04:38 AM, Craig Ringer wrote: > > On 1 May 2017 at 22:26, Andreas Karlsson wrote: > > > I am not sure I like decorators since this means adding an ad hoc query > > > hint > > > directly into the

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Alvaro Herrera
Petr Jelinek wrote: > On 02/05/17 18:00, Robert Haas wrote: > > On Tue, May 2, 2017 at 11:49 AM, Alvaro Herrera > > wrote: > >> Petr Jelinek wrote: > >>> So the only way to fulfill the requirement you stated is to just not try > >>> to drop the slot, ever, on DROP

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 18:00, Robert Haas wrote: > On Tue, May 2, 2017 at 11:49 AM, Alvaro Herrera > wrote: >> Petr Jelinek wrote: >>> So the only way to fulfill the requirement you stated is to just not try >>> to drop the slot, ever, on DROP SUBSCRIPTION. That makes the default

[HACKERS] Re: Potential hot-standby bug around xacts committed but in xl_running_xacts

2017-05-02 Thread Andres Freund
On 2017-05-02 07:12:41 +0200, Simon Riggs wrote: > /* > * The running-xacts snapshot can contain xids that were still visible > * in the procarray when the snapshot was taken, but were already > * WAL-logged as completed. They're not running anymore, so ignore > * them. > */ > if

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

2017-05-02 Thread Rahila Syed
Please find attached updated patch with review comments by Robert and Jeevan implemented. The newly proposed syntax CREATE TABLE .. PARTITION OF .. DEFAULT has got most votes on this thread. If there is no more objection, I will go ahead and include that in the patch. Thank you, Rahila Syed On

Re: [HACKERS] CTE inlining

2017-05-02 Thread Thomas Kellerer
> Relevant posts where users get confused by our behaviour: > And Markus Winand's blog: http://modern-sql.com/feature/with/performance Databases generally obey this principle, although PostgreSQL represents a big exception and Besides PostgreSQL, all tested databases optimize

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Robert Haas
On Tue, May 2, 2017 at 11:49 AM, Alvaro Herrera wrote: > Petr Jelinek wrote: >> So the only way to fulfill the requirement you stated is to just not try >> to drop the slot, ever, on DROP SUBSCRIPTION. That makes the default >> behavior leave resources on upstream that

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Alvaro Herrera
Petr Jelinek wrote: > So the only way to fulfill the requirement you stated is to just not try > to drop the slot, ever, on DROP SUBSCRIPTION. That makes the default > behavior leave resources on upstream that will eventually cause that > server to stop unless user notices before. I think we

Re: [HACKERS] CTE inlining

2017-05-02 Thread Tomas Vondra
On 5/2/17 4:44 PM, Andrew Dunstan wrote: On 05/02/2017 10:13 AM, Merlin Moncure wrote: On Sun, Apr 30, 2017 at 6:21 PM, Andres Freund wrote: On 2017-04-30 07:19:21 +0200, Pavel Stehule wrote: why we cannot to introduce GUC option - enable_cteoptfence ? Doesn't really

Re: [HACKERS] Re: logical replication and PANIC during shutdown checkpoint in publisher

2017-05-02 Thread Peter Eisentraut
On 5/1/17 13:43, Peter Eisentraut wrote: > On 4/30/17 20:52, Noah Misch wrote: >> IMMEDIATE ATTENTION REQUIRED. This PostgreSQL 10 open item is long past due >> for your status update. Please thoroughly reacquaint yourself with the >> policy >> on open item ownership[1] and then reply

Re: [HACKERS] logical replication and PANIC during shutdown checkpoint in publisher

2017-05-02 Thread Peter Eisentraut
On 5/2/17 10:08, Michael Paquier wrote: > On Tue, May 2, 2017 at 9:30 PM, Peter Eisentraut > wrote: >> On 5/2/17 03:11, Petr Jelinek wrote: >>> logical decoding can theoretically >>> do HOT pruning (even if the chance is really small) so it's not safe to >>>

Re: [HACKERS] Logical replication in the same cluster

2017-05-02 Thread Petr Jelinek
On 02/05/17 16:37, Andres Freund wrote: > On 2017-05-02 09:17:27 +0200, Petr Jelinek wrote: >> Yes because otherwise we risk leaving slot on the upstream if the >> command fails downstream. > > Shouldn't temporary slots be able to solve that concern? Create it as > temporary at the beginning,

Re: [HACKERS] CTE inlining

2017-05-02 Thread Andrew Dunstan
On 05/02/2017 10:13 AM, Merlin Moncure wrote: > On Sun, Apr 30, 2017 at 6:21 PM, Andres Freund wrote: >> On 2017-04-30 07:19:21 +0200, Pavel Stehule wrote: >>> why we cannot to introduce GUC option - enable_cteoptfence ? >> Doesn't really solve the issue, and we've generally

Re: [HACKERS] Logical replication in the same cluster

2017-05-02 Thread Andres Freund
On 2017-05-02 09:17:27 +0200, Petr Jelinek wrote: > Yes because otherwise we risk leaving slot on the upstream if the > command fails downstream. Shouldn't temporary slots be able to solve that concern? Create it as temporary at the beginning, mark it as permanent at the end? Greetings, Andres

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 15:31, Tom Lane wrote: > Petr Jelinek writes: >> Let me expand, if we don't drop the slot by default when dropping >> subscription, we'll have a lot of users with dead slots laying around >> holding back WAL/catalog_xmin, that's really bad. If we do drop

Re: [HACKERS] CTE inlining

2017-05-02 Thread Merlin Moncure
On Sun, Apr 30, 2017 at 6:21 PM, Andres Freund wrote: > On 2017-04-30 07:19:21 +0200, Pavel Stehule wrote: >> why we cannot to introduce GUC option - enable_cteoptfence ? > > Doesn't really solve the issue, and we've generally shied away from GUCs > that influence behaviour

Re: [HACKERS] logical replication and PANIC during shutdown checkpoint in publisher

2017-05-02 Thread Michael Paquier
On Tue, May 2, 2017 at 9:30 PM, Peter Eisentraut wrote: > On 5/2/17 03:11, Petr Jelinek wrote: >> logical decoding can theoretically >> do HOT pruning (even if the chance is really small) so it's not safe to >> start logical replication either. > > This seems a

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Joshua D. Drake
On 05/02/2017 05:13 AM, Tom Lane wrote: Robert Haas writes: On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek wrote: DROP SUBSCRIPTION mysub NODROP SLOT; Having said that, I doubt that anyone would argue that CREATE USER is anything but

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Tom Lane
Petr Jelinek writes: > Let me expand, if we don't drop the slot by default when dropping > subscription, we'll have a lot of users with dead slots laying around > holding back WAL/catalog_xmin, that's really bad. If we do drop by > default like now, we need option to

Re: [HACKERS] check with serial

2017-05-02 Thread Andrew Dunstan
On 05/01/2017 09:39 AM, Andrew Dunstan wrote: > The other day I wanted to run "make check" but with the serial schedule. > This wasn't as easy as it should have been. Although we now have > installcheck-parallel we don't have check-serial. Should we have that? > Alternatively, should we allow a

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 15:14, Petr Jelinek wrote: > On 02/05/17 15:10, Tom Lane wrote: >> Robert Haas writes: On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek wrote: > DROP SUBSCRIPTION mysub NODROP SLOT; >> I'm pretty uninspired by this

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 15:10, Tom Lane wrote: > Robert Haas writes: >>> On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek >>> wrote: DROP SUBSCRIPTION mysub NODROP SLOT; > >>> I'm pretty uninspired by this choice of syntax. > > Actually, this command

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Tom Lane
Robert Haas writes: >> On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek >> wrote: >>> DROP SUBSCRIPTION mysub NODROP SLOT; >> I'm pretty uninspired by this choice of syntax. Actually, this command has got much worse problems than whether you

Re: [HACKERS] CTE inlining

2017-05-02 Thread Oleg Bartunov
On Mon, May 1, 2017 at 7:22 AM, Pavel Stehule wrote: > > > 2017-05-01 1:21 GMT+02:00 Andres Freund : >> >> On 2017-04-30 07:19:21 +0200, Pavel Stehule wrote: >> > why we cannot to introduce GUC option - enable_cteoptfence ? >> >> Doesn't really solve

Re: [HACKERS] UPDATE of partition key

2017-05-02 Thread Robert Haas
On Tue, Apr 4, 2017 at 7:11 AM, Amit Khandekar wrote: > Attached updated patch v7 has the above changes. This no longer applies. Please rebase. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Petr Jelinek
On 02/05/17 14:13, Tom Lane wrote: > Robert Haas writes: >> On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek >> wrote: >>> DROP SUBSCRIPTION mysub NODROP SLOT; > >> I'm pretty uninspired by this choice of syntax. Logical replication >> seems to

Re: [HACKERS] logical replication and PANIC during shutdown checkpoint in publisher

2017-05-02 Thread Michael Paquier
On Tue, May 2, 2017 at 9:27 PM, Peter Eisentraut wrote: > On 5/2/17 03:43, Michael Paquier wrote: >>> I don't think the code covers all because a) the SQL queries are not >>> covered at all that I can see and b) logical decoding can theoretically >>> do HOT

Re: [HACKERS] CTE inlining

2017-05-02 Thread Andreas Karlsson
On 05/02/2017 04:38 AM, Craig Ringer wrote: On 1 May 2017 at 22:26, Andreas Karlsson wrote: I am not sure I like decorators since this means adding an ad hoc query hint directly into the SQL syntax which is something which I requires serious consideration. And mangling the

Re: [HACKERS] Shared Memory hash tables only at startup

2017-05-02 Thread Tom Lane
hariprasath nallasamy writes: > *(In practice, all creations are done in the postmasterprocess; child > processes should always be attaching to existing tables.)* Yeah ... > Is there any specific reason to do so or my understanding was wrong(we can > create

Re: [HACKERS] logical replication and PANIC during shutdown checkpoint in publisher

2017-05-02 Thread Peter Eisentraut
On 5/2/17 03:11, Petr Jelinek wrote: > logical decoding can theoretically > do HOT pruning (even if the chance is really small) so it's not safe to > start logical replication either. This seems a bit impossible to resolve. On the one hand, we want to allow streaming until after the shutdown

Re: [HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Tom Lane
Michael Paquier writes: > On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram wrote: >> Please suggest me the easiest way to lookup into PK's B-Tree index for >> getting TIDs. > Why don't you just use SPI within your extension? No need to copy the > logic

Re: [HACKERS] logical replication and PANIC during shutdown checkpoint in publisher

2017-05-02 Thread Peter Eisentraut
On 5/2/17 03:43, Michael Paquier wrote: >> I don't think the code covers all because a) the SQL queries are not >> covered at all that I can see and b) logical decoding can theoretically >> do HOT pruning (even if the chance is really small) so it's not safe to >> start logical replication either.

Re: [HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Craig Ringer
On 2 May 2017 7:34 pm, "Michael Paquier" wrote: On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram wrote: > I'm building some custom extension on top of postgres 9.6.1. As part of > that, I would like to read Heap Tuple directly from my extension using >

Re: [HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread zosrothko
Le 02/05/2017 à 13:22, Michael Paquier a écrit : > The PostgreSQL uses a set of scripts in src/tools/msvc/ to generate > things compiled with visual studio, so instinctively you would be > looking at working on that. Honestly, just by looking at the files you > are proposing, it is hard to make an

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Thom Brown
On 2 May 2017 at 12:55, Robert Haas wrote: > On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek > wrote: >> DROP SUBSCRIPTION mysub NODROP SLOT; > > I'm pretty uninspired by this choice of syntax. Logical replication > seems to have added a whole

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Tom Lane
Robert Haas writes: > On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek > wrote: >> DROP SUBSCRIPTION mysub NODROP SLOT; > I'm pretty uninspired by this choice of syntax. Logical replication > seems to have added a whole bunch of syntax that

Re: [HACKERS] vcregress support for single TAP tests

2017-05-02 Thread Andrew Dunstan
On 05/02/2017 12:19 AM, Vaishnavi Prabakaran wrote: > > > > On Mon, May 1, 2017 at 11:01 PM, Andrew Dunstan > > wrote: > > > > In the absence of further comments I'm going to apply this and > back-patch it so we can

Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)

2017-05-02 Thread Robert Haas
On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek wrote: > DROP SUBSCRIPTION mysub NODROP SLOT; I'm pretty uninspired by this choice of syntax. Logical replication seems to have added a whole bunch of syntax that involves prefixing words with "no". In various places,

[HACKERS] Shared Memory hash tables only at startup

2017-05-02 Thread hariprasath nallasamy
Hi It is clear that all of the shared memory hash tables are created during startup using *ShmemInitHash() * *(In practice, all creations are done in the postmasterprocess; child processes should always be attaching to existing tables.)* Is there any specific reason to do so or my

Re: [HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Michael Paquier
On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram wrote: > I'm building some custom extension on top of postgres 9.6.1. As part of > that, I would like to read Heap Tuple directly from my extension using > Primary Key. > > By default, postgres table index(B-Tree) its

[HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread Francis ANDRE
Hi I made an extension of VisualStudio that precompiles automaticaly C or C++ source with PostgreSQL Embedded SQL. The extension is made of the 3 files joined and I have no idea where they should be placed in the PostgreSQL source tree. Anybody interested in pushing this extension? FA

Re: [HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread Michael Paquier
On Tue, May 2, 2017 at 6:35 PM, zosrothko wrote: > Hi > > I made an extension of VisualStudio that precompiles automaticaly C or > C++ source with PostgreSQL Embedded SQL. The extension is made of the 3 > files joined and I have no idea where they should be placed in the >

[HACKERS] Typos in comments in partition.c

2017-05-02 Thread Etsuro Fujita
Hi, I ran into typos in comments in RelationGetPartitionDispatchInfo() in partition.c. Here is a small patch for: s/all the leaf partition/all the leaf partitions/ and s/we we/we/. Best regards, Etsuro Fujita diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c

Re: [HACKERS] Bug in prepared statement cache invalidation?

2017-05-02 Thread Konstantin Knizhnik
On 01.05.2017 16:09, Robert Haas wrote: This problem has been discussed before but nobody's done anything about it. The problem is a bit tricky because the core system doesn't know anything about the function caches maintained by individual PLs. I suppose ideally there'd be a way for a PL to

Re: [HACKERS] Cached plans and statement generalization

2017-05-02 Thread Konstantin Knizhnik
On 01.05.2017 18:52, Robert Haas wrote: On Fri, Apr 28, 2017 at 6:01 AM, Konstantin Knizhnik > wrote: Any comments and suggestions for future improvement of this patch are welcome. +PG_TRY(); +{ +

Re: [HACKERS] multi-column range partition constraint

2017-05-02 Thread Beena Emerson
On Tue, May 2, 2017 at 2:47 PM, Amit Langote wrote: > Hi Beena, > > On 2017/05/02 17:47, Beena Emerson wrote: > > Hello Amit, > > > > On Tue, May 2, 2017 at 12:21 PM, Amit Langote < > langote_amit...@lab.ntt.co.jp > >> wrote: > > > >> Per an off-list report from

[HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread zosrothko
Hi I made an extension of VisualStudio that precompiles automaticaly C or C++ source with PostgreSQL Embedded SQL. The extension is made of the 3 files joined and I have no idea where they should be placed in the PostgreSQL source tree. Anybody interested in pushing this extension? zos

Re: [HACKERS] multi-column range partition constraint

2017-05-02 Thread Amit Langote
Hi Beena, On 2017/05/02 17:47, Beena Emerson wrote: > Hello Amit, > > On Tue, May 2, 2017 at 12:21 PM, Amit Langote > wrote: > >> Per an off-list report from Olaf Gawenda (thanks Olaf), it seems that the >> range partition's constraint is sometimes incorrect, at

Re: [HACKERS] [PostgreSQL 10] default of hot_standby should be "on"?

2017-05-02 Thread Magnus Hagander
On Fri, Apr 28, 2017 at 3:43 AM, Masahiko Sawada wrote: > On Thu, Apr 27, 2017 at 11:05 PM, Huong Dangminh > wrote: > >> >>> I would refrain from doing that, having some parameters listed in > the > >> >>> tests makes the intention behind those

[HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Mahi Gurram
Hi, I'm building some custom extension on top of postgres 9.6.1. As part of that, I would like to read Heap Tuple directly from my extension using Primary Key. By default, postgres table index(B-Tree) its PrimaryKey(PK). So, i would like to get TID by doing a lookup into PK's B-Tree index. Using

Re: [HACKERS] multi-column range partition constraint

2017-05-02 Thread Beena Emerson
Hello Amit, On Tue, May 2, 2017 at 12:21 PM, Amit Langote wrote: > Per an off-list report from Olaf Gawenda (thanks Olaf), it seems that the > range partition's constraint is sometimes incorrect, at least in the case > of multi-column range partitioning. See

  1   2   >