Re: [HACKERS] proposal psql \gdesc

2017-05-02 Thread Pavel Stehule
2017-04-28 6:08 GMT+02:00 Pavel Stehule : > Hi > > Sometimes I have to solve the result types of some query. It is invisible > in psql. You have to materialize table or you have to create view. Now, > when we can enhance \g command, we can introduce query describing > > some like > > select a, b f

Re: [HACKERS] Time based lag tracking for logical replication

2017-05-02 Thread Petr Jelinek
On 03/05/17 08:28, Simon Riggs wrote: > On 23 April 2017 at 01:10, Petr Jelinek wrote: >> Hi, >> >> The time based lag tracking commit [1] added interface for logging >> progress of replication so that we can report lag as time interval >> instead of just bytes. But the patch didn't contain patch

Re: [HACKERS] Time based lag tracking for logical replication

2017-05-02 Thread Thomas Munro
On Wed, May 3, 2017 at 6:28 PM, Simon Riggs wrote: > On 23 April 2017 at 01:10, Petr Jelinek wrote: >> Hi, >> >> The time based lag tracking commit [1] added interface for logging >> progress of replication so that we can report lag as time interval >> instead of just bytes. But the patch didn't

Re: [HACKERS] Time based lag tracking for logical replication

2017-05-02 Thread Simon Riggs
On 23 April 2017 at 01:10, Petr Jelinek wrote: > Hi, > > The time based lag tracking commit [1] added interface for logging > progress of replication so that we can report lag as time interval > instead of just bytes. But the patch didn't contain patch for the > builtin logical replication. > > So

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

2017-05-02 Thread Petr Jelinek
On 02/05/17 20:43, Robert Haas wrote: > 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_re

Re: [HACKERS] Inefficient shutdown of pg_basebackup

2017-05-02 Thread Simon Riggs
On 27 April 2017 at 05:31, Tom Lane wrote: > The attached draft patch fixes this by expanding the StreamCtl API > with a socket that the low-level wait routine should check for input. > For me, this consistently knocks about 10 seconds off the runtime of > 001_stream_rep.pl. That is good. I noti

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 a separate function for emitting error message

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 Boehlert >> Email address: henry_boehl...@agilent.co

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 wrote: > 1. Just remove the optimization fence and le

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 > to drop the slot, eve

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 this. I am not sure how much advant

[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 > Operating system: Windows

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 it,

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, installc

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 partitioning. > > I suggest that we consider t

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 Eisentraut wrote: > On 4/9/17

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 trigger LANGUAGE plpgsql

[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 Developmen

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 nobody's written yet. > > That mechanism already e

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. This is (effectively) an

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 underlying table. >

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 2017 at 22:26, Andreas Karlsson

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 should always be attaching to existi

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 type

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 concerned: register a s

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 >>> to be disappointing. >> >> T

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 table p (a int, b int) partition

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 documentation could also be impr

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 th

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, i.e. don't cause a transaction abort. >> > An

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. >> >> Just after the ALTER TABLE stat

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 Karlsson wrote: > >>> >>> >>> ... >>

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 add a PG_TRY block, but we

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 in removing the '=' in between

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 a

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 set of minor release

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 > for number of workers for a

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 backend-lif

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 could I would have done it). 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: http://www.postgresql.org/

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. > > Tom> Just to clarify, what do you think is "pro

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 support >> for what "pa

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 EnterpriseDB: http://www.enterpr

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() inside the if above after the >> C

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 > relations/types/functions and s

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 flaw. It will be much better

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 was least some talk of changing

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 > the OFF or FALSE (ie DROP SLOT O

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 > dislike adding those

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 >> 3. Now the full XL

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 optimization fence a

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 going to > be a hard

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 > uncommitted rows and rejects dead r

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 SQL syntax which is

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 SUBSCRIPTION. That makes the defa

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 >>> behavior leave resources

[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 (Transaction

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 wit

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 will eventually cause 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 bette

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 solve the issue, and w

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 immediatel

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 >>> start logical replication either. >> >>

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, mar

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 shied away from GUCs

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 by >> default like now, we need

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 after a few bad experie

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 bit impossible to resolve. On the o

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 legacy syntax, or that our more recent syntax designs are

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 not do that, neither RESTRICT,

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 S

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 choice of syntax. >> >> Actually, this command has got

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 has got much worse problems than whether you like > th

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 like the spelling of its option: it shouldn't have an op

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 the issue, and we've generally shied away from

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 mailing list (pgsql-hackers@po

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 have added a whole bunch of syntax that involves pref

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 pruning (even if the chance is really sm

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 semantics of existi

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 shared memory hash table at run time t

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 chec

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 for btree lookups this way. There's not actuall

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 > Primary Key. > > By default, postgres table inde

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 bunch of syntax that involves prefixing > words with "

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 involves prefixing > words with "no". In various places,

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 get a significant improvement in

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, there's NODROP, NOREFRESH, NOCO

[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 understanding

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 PrimaryKey(PK). So, i would > like t

[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 ecpg.pr

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 > PostgreSQL source tree.

[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 in

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 mailto:k.knizh...@postgrespro.ru>> wrote: Any comments and suggestions for future improvement of this patch are welcome. +PG_TRY(); +{ +query = parse_analyze_var

  1   2   >