Re: [HACKERS] PQhost may return socket dir for network connection

2017-05-09 Thread Kyotaro HORIGUCHI
At Mon, 1 May 2017 15:48:17 -0400, Robert Haas wrote in > On Mon, May 1, 2017 at 1:36 PM, Tom Lane wrote: > > Robert Haas writes: > >> On Mon, May 1, 2017 at 12:06 PM, Tom Lane wrote: > >>> Having said that, the behavior stated in $subject does sound wrong. > > > >> I'm not sure. My understa

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

2017-05-09 Thread Noah Misch
On Mon, May 08, 2017 at 10:30:45PM -0700, Noah Misch wrote: > On Fri, May 05, 2017 at 07:07:26AM +, Noah Misch wrote: > > On Wed, May 03, 2017 at 08:28:53AM +0200, Simon Riggs wrote: > > > On 23 April 2017 at 01:10, Petr Jelinek > > > wrote: > > > > Hi, > > > > > > > > The time based lag trac

Re: [HACKERS] Remove pre-10 compatibility code in hash index

2017-05-09 Thread Amit Kapila
On Wed, May 10, 2017 at 9:17 AM, Robert Haas wrote: > On Tue, May 9, 2017 at 1:41 AM, Amit Kapila wrote: >> Commit ea69a0dead5128c421140dc53fac165ba4af8520 has bumped the hash >> index version and obviates the need for backward compatibility code >> added by commit 293e24e507838733aba4748b514536a

Re: [HACKERS] bumping HASH_VERSION to 3

2017-05-09 Thread Amit Kapila
On Tue, Apr 11, 2017 at 11:53 PM, Bruce Momjian wrote: > On Fri, Mar 31, 2017 at 02:48:05PM -0400, Tom Lane wrote: >> +1, as long as we're clear on what will happen when pg_upgrade'ing >> an installation containing hash indexes. I think a minimum requirement is >> that it succeed and be able to s

Fwd: Re: [HACKERS] MSVC odd TAP test problem

2017-05-09 Thread Andrew Dunstan
On 05/09/2017 09:37 PM, Michael Paquier wrote: > On Wed, May 10, 2017 at 2:11 AM, Andrew Dunstan > wrote: >> (After extensive trial and error) Turns out it's not quite that, it's >> the kill_kill stuff. I think for now we should just disable it on the >> platform. That means not running tests 7

[HACKERS] [doc fix] PG10: wroing description on connect_timeout when multiple hosts are specified

2017-05-09 Thread Tsunakawa, Takayuki
Hello, Robert I found a wrong sentence here in the doc. I'm sorry, this is what I asked you to add... https://www.postgresql.org/docs/devel/static/libpq-connect.html#libpq-paramkeywords connect_timeout Maximum wait for connection, in seconds (write as a decimal integer string). Zero or not sp

Re: [HACKERS] Declarative partitioning - another take

2017-05-09 Thread Amit Langote
On 2017/05/10 12:59, Robert Haas wrote: > On Tue, May 9, 2017 at 11:54 PM, Thomas Munro > wrote: >> +A statement that targets a parent table in a inheritance or partitioning >> >> A tiny typo: s/a inheritance/an inheritance/ > > Now he tells me. Thanks both. Regards, Amit -- Sent via pg

Re: [HACKERS] [BUGS] Concurrent ALTER SEQUENCE RESTART Regression

2017-05-09 Thread Peter Eisentraut
On 5/7/17 19:43, Andres Freund wrote: > 3. Keep the catalog, make ALTER properly transactional, blocking >concurrent nextval()s. This resolves the issue that nextval() can't >see the changed definition of the sequence. This was the intended choice. I think I have more clarity about the di

Re: [HACKERS] Removal of plaintext password type references

2017-05-09 Thread Michael Paquier
On Wed, May 10, 2017 at 10:51 AM, Vaishnavi Prabakaran wrote: > Following recent removal of support to store password in plain text, > modified the code to > > 1. Remove "PASSWORD_TYPE_PLAINTEXT" macro > 2. Instead of using "get_password_type" to retrieve the encryption method > AND to check if t

Re: [HACKERS] .pgpass's behavior has changed

2017-05-09 Thread Kyotaro HORIGUCHI
At Mon, 1 May 2017 11:34:41 -0400, Robert Haas wrote in > On Fri, Apr 28, 2017 at 3:54 AM, Kyotaro HORIGUCHI > wrote: > > But the above also leaves a bug so I sent another patch to fix > > it. The attched patch restores the 9.6's beavior of looking up > > .pgpass file in the same manner to the

Re: [HACKERS] Declarative partitioning - another take

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 11:54 PM, Thomas Munro wrote: > +A statement that targets a parent table in a inheritance or partitioning > > A tiny typo: s/a inheritance/an inheritance/ Now he tells me. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --

Re: [HACKERS] May cause infinite loop when initializing rel-cache contains partitioned table

2017-05-09 Thread Robert Haas
On Mon, May 8, 2017 at 5:07 AM, Amit Langote wrote: > Thanks for bringing it to the notice. The above code should follow what's > done for other fields that are initialized by > RelationCacheInitializePhase3(). Although, since none of the entries in > the relcache init file are partitioned table

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

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 11:48 PM, Thomas Munro wrote: > Hmm. DB2 has transition tables (invented them maybe?) and it allows > OLD/NEW TABLE on row-level triggers: > > https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/t0020236.html Yeah, my impression

Re: [HACKERS] Declarative partitioning - another take

2017-05-09 Thread Thomas Munro
On Wed, May 10, 2017 at 3:51 PM, Robert Haas wrote: > On Sun, May 7, 2017 at 9:44 PM, Amit Langote > wrote: >> I think that makes sense. Modified it to read: "A statement that targets >> a parent table in a inheritance or partitioning hierarchy..." in the >> attached updated patch. > > LGTM. Co

Re: [HACKERS] Declarative partitioning - another take

2017-05-09 Thread Robert Haas
On Sun, May 7, 2017 at 9:44 PM, Amit Langote wrote: > I think that makes sense. Modified it to read: "A statement that targets > a parent table in a inheritance or partitioning hierarchy..." in the > attached updated patch. LGTM. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb

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

2017-05-09 Thread Thomas Munro
On Wed, May 10, 2017 at 11:22 AM, Thomas Munro wrote: > On Wed, May 10, 2017 at 9:57 AM, Alvaro Herrera > wrote: >> Thomas Munro wrote: >> >>> Recall that transition tables can be specified for statement-level >>> triggers AND row-level triggers. If you specify them for row-level >>> triggers, t

Re: [HACKERS] Remove pre-10 compatibility code in hash index

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 1:41 AM, Amit Kapila wrote: > Commit ea69a0dead5128c421140dc53fac165ba4af8520 has bumped the hash > index version and obviates the need for backward compatibility code > added by commit 293e24e507838733aba4748b514536af2d39d7f2. The same > has been mentioned in the commit me

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

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 4:26 AM, Etsuro Fujita wrote: > Here is a small patch to fix typos in comments for InitResultRelInfo() in > execMain.c: s/ResultRelationInfo/ResultRelInfo/ and s/the the/the/. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Co

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

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 11:40 PM, Thomas Munro wrote: > On Wed, May 10, 2017 at 2:31 PM, Amit Langote > wrote: >> On 2017/05/10 6:51, Thomas Munro wrote: >>> No such problem exists for partition hierarchies since the tables all >>> appear as the same type to user code (though conversions may be >>

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

2017-05-09 Thread Thomas Munro
On Wed, May 10, 2017 at 2:31 PM, Amit Langote wrote: > On 2017/05/10 6:51, Thomas Munro wrote: >> No such problem exists for partition hierarchies since the tables all >> appear as the same type to user code (though conversions may be >> happening for technical reasons). > > To clarify a bit, ther

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

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 11:24 PM, Thomas Munro wrote: > Since the last one conflicted with recent changes, here's a rebased > patch to prevent transition tables on views and foreign tables. Committed, but I made the new error details more like the existing one that also checks relkind. -- Robert

Re: [HACKERS] delta relations in AFTER triggers

2017-05-09 Thread Robert Haas
On Thu, May 4, 2017 at 4:23 PM, Thomas Munro wrote: > We can't possibly support transition tables on TRUNCATE (the whole > point of TRUNCATE is not to inspect all the rows so we can't collect > them), and we already reject ROW triggers on TRUNCATE, so we should > reject transition tables on STATEM

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

2017-05-09 Thread Thomas Munro
Hi, Since the last one conflicted with recent changes, here's a rebased patch to prevent transition tables on views and foreign tables. -- Thomas Munro http://www.enterprisedb.com prevent-unsupported-transition-tables-v2.patch Description: Binary data -- Sent via pgsql-hackers mailing list (

Re: [HACKERS] delta relations in AFTER triggers

2017-05-09 Thread Robert Haas
On Thu, May 4, 2017 at 5:51 AM, Thomas Munro wrote: > Reproduced here. The stack looks like this: > > frame #3: 0x00010f06f8b0 > postgres`ExceptionalCondition(conditionName="!(readptr->eflags & > 0x0002)", errorType="FailedAssertion", fileName="tuplestore.c", > lineNumber=1237) + 128 at a

Re: [HACKERS] multi-column range partition constraint

2017-05-09 Thread Robert Haas
On Mon, May 8, 2017 at 2:59 AM, Amit Langote wrote: > Yes, disallowing this in the first place is the best thing to do. > Attached patch 0001 implements that. With the patch: Committed. With regard to 0002, some of the resulting constraints are a bit more complicated than seems desirable: crea

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-05-09 Thread Masahiko Sawada
On Wed, May 10, 2017 at 2:46 AM, Masahiko Sawada wrote: > On Mon, May 8, 2017 at 8:42 PM, Petr Jelinek > wrote: >> On 08/05/17 11:27, Masahiko Sawada wrote: >>> Hi, >>> >>> I encountered a situation where DROP SUBSCRIPTION got stuck when >>> initial table sync is in progress. In my environment, I

Re: [HACKERS] delta relations in AFTER triggers

2017-05-09 Thread Noah Misch
On Sat, May 06, 2017 at 05:34:46AM +, Noah Misch wrote: > On Fri, May 05, 2017 at 08:23:33AM +1200, Thomas Munro wrote: > > On Fri, May 5, 2017 at 12:39 AM, Neha Sharma > > wrote: > > > While testing the feature we encountered one more crash,below is the > > > scenario to reproduce. > > > > >

Re: [HACKERS] delta relations in AFTER triggers

2017-05-09 Thread Noah Misch
On Sat, May 06, 2017 at 05:33:24AM +, Noah Misch wrote: > On Thu, May 04, 2017 at 09:51:03PM +1200, Thomas Munro wrote: > > On Thu, May 4, 2017 at 9:12 PM, Prabhat Sahu > > wrote: > > > I have been testing this for a while and observed a server crash while > > > referencing table column value

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

2017-05-09 Thread Noah Misch
On Mon, May 08, 2017 at 12:00:20AM -0700, Noah Misch wrote: > On Sat, May 06, 2017 at 06:58:35PM +, Noah Misch wrote: > > On Tue, May 02, 2017 at 06:06:47PM -0500, Kevin Grittner wrote: > > > On Fri, Apr 28, 2017 at 10:56 PM, Tom Lane wrote: > > > > > > > They will fire if you have an INSTEAD

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread Chapman Flack
On 05/09/17 18:48, Mark Dilger wrote: > I don't have any positive expectation that the postgres community will go > along with any of this, but just from my point of view, the cleaner way to > do what you are proposing is something like setting a session variable. > > In your middle tier java app

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

2017-05-09 Thread Amit Langote
On 2017/05/10 6:51, Thomas Munro wrote: > No such problem exists for partition hierarchies since the tables all > appear as the same type to user code (though conversions may be > happening for technical reasons). To clarify a bit, there may exist differences in the ordering of columns, either bet

[HACKERS] how to shrink pg_attribute table?

2017-05-09 Thread xu jian
Hello, My application creates temp table frequently. Now I find pg_attribute table is growing larger and larger, 90GB now. pgstattuple shows 82% free space, so I restored the db to dev env, and tried vacuum full to shrink it. However, the vacuum full run for 24 hours, and hang there.

[HACKERS] Removal of plaintext password type references

2017-05-09 Thread Vaishnavi Prabakaran
Hi All, Following recent removal of support to store password in plain text, modified the code to 1. Remove "PASSWORD_TYPE_PLAINTEXT" macro 2. Instead of using "get_password_type" to retrieve the encryption method AND to check if the password is already encrypted or not, modified the code to a.

Re: [HACKERS] MSVC odd TAP test problem

2017-05-09 Thread Michael Paquier
On Wed, May 10, 2017 at 2:11 AM, Andrew Dunstan wrote: > (After extensive trial and error) Turns out it's not quite that, it's > the kill_kill stuff. I think for now we should just disable it on the > platform. That means not running tests 7 and 8 of the logical_decoding > tests and all of the cra

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

2017-05-09 Thread Amit Langote
On 2017/05/10 2:09, Robert Haas wrote: > On Tue, May 9, 2017 at 9:26 AM, Rahila Syed wrote: >>> Hi Rahila, >> >>> I am not able add a new partition if default partition is further >>> partitioned >>> with default partition. >> >>> Consider example below: >> >>> postgres=# CREATE TABLE test ( a int

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-05-09 Thread Amit Langote
On 2017/05/09 22:52, Mark Dilger wrote: > >> On May 9, 2017, at 12:18 AM, Amit Langote >> wrote: >> >> Hi, >> >> On 2017/05/05 9:38, Mark Dilger wrote: >>> Hackers, >>> >>> just FYI, I cannot find any regression test coverage of this part of the >>> grammar, not >>> even in the contrib/ directo

Re: [HACKERS] SUBSCRIPTIONS and pg_upgrade

2017-05-09 Thread Michael Paquier
On Wed, May 10, 2017 at 12:00 AM, Peter Eisentraut wrote: > On 5/9/17 04:54, Petr Jelinek wrote: >>> I think that it would be nice to fix that even before beta, so >>> attached is a patch to add --no-subscriptions to pg_dump, pg_dumpall >>> and pg_restore. >> >> Looks okay to me, it's simple enoug

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

2017-05-09 Thread Thomas Munro
On Wed, May 10, 2017 at 9:57 AM, Alvaro Herrera wrote: > Thomas Munro wrote: > >> Recall that transition tables can be specified for statement-level >> triggers AND row-level triggers. If you specify them for row-level >> triggers, then they can see all rows changed so far each time they >> fire.

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread Mark Dilger
> On May 9, 2017, at 3:14 PM, Chapman Flack wrote: > > On 05/09/2017 01:25 PM, Mark Dilger wrote: > >> Consensus, no, but utility, yes. >> >> In three tier architectures there is a general problem that the database >> role used by the middle tier to connect to the database does not entail >> i

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread Chapman Flack
On 05/09/2017 01:25 PM, Mark Dilger wrote: > Consensus, no, but utility, yes. > > In three tier architectures there is a general problem that the database > role used by the middle tier to connect to the database does not entail > information about the user who, such as a visitor to your website,

Re: [HACKERS] CTE inlining

2017-05-09 Thread Andrew Dunstan
On 05/09/2017 04:14 PM, Tom Lane wrote: > > Well, TBH that is pre-judging what (if anything) is going to be changed > by a feature that we don't even have design consensus on, let alone a > patch for. I don't think that's an improvement or a good service to > our users; it's just promoting confu

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

2017-05-09 Thread Alvaro Herrera
Thomas Munro wrote: > Recall that transition tables can be specified for statement-level > triggers AND row-level triggers. If you specify them for row-level > triggers, then they can see all rows changed so far each time they > fire. Uhmm ... why do we do this? It seems like a great way to cau

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

2017-05-09 Thread Thomas Munro
On Tue, May 9, 2017 at 10:29 PM, Thomas Munro wrote: > In master, the decision to populate transition tables happens in > AfterTriggerSaveEvent (called by the ExecAR* functions) in trigger.c. > It does that if it sees that there are triggers on the > relation-being-modified that have transition ta

[HACKERS] Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-05-09 Thread Alvaro Herrera
Hi Mengxing, Mengxing Liu wrote: > Hi, Alvaro and Kevin. I'm Mengxing. > > This is a “synchronization” email to tell you what I've done and my next > plan. I'm looking forward to your advice. Welcome! > According to my proposal, I want to prepare the experimental environment > during the

Re: [HACKERS] CTE inlining

2017-05-09 Thread Tom Lane
Ilya Shkuratov writes: > Ok, it seems that most people in discussion are agree that removing > optimization > fence is a right thing to do. > Nonetheless I still hoping to discuss the algorithm and its implementation. Yeah, so far we've mainly discussed whether to do that and how to control it,

Re: [HACKERS] export import bytea from psql

2017-05-09 Thread Daniel Verite
Pavel Stehule wrote: > 1. using psql variables - we just need to write commands \setfrom > \setfrombf - this should be very simple implementation. The value can be > used more times. On second hand - the loaded variable can hold lot of > memory (and it can be invisible for user). This cou

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Fabien COELHO
What about detecting the empty result (eg PQntuples()==0?) and writing "Empty result" instead of the strange looking empty table above? That would just mean skipping the PrintQueryResult call in this case? PQntuples == 0 every time - the query is not executed. I meant to test the query which

Re: [HACKERS] CTE inlining

2017-05-09 Thread Tom Lane
"David G. Johnston" writes: > On Tue, May 9, 2017 at 12:36 PM, Tom Lane wrote: >> Also, considering that this behavior has been there since 8.4, >> I think it's sheerest chutzpah to claim that changing the docs in >> v10 would materially reduce the backward-compatibility concerns >> for whatever

Re: [HACKERS] snapbuild woes

2017-05-09 Thread Erik Rijkers
On 2017-05-09 21:00, Petr Jelinek wrote: On 09/05/17 19:54, Erik Rijkers wrote: On 2017-05-09 11:50, Petr Jelinek wrote: Ah okay, so this is same issue that's reported by both Masahiko Sawada [1] and Jeff Janes [2]. [1] https://www.postgresql.org/message-id/CAD21AoBYpyqTSw%2B%3DES%2BxXtRGMPK

Re: [HACKERS] CTE inlining

2017-05-09 Thread David G. Johnston
On Tue, May 9, 2017 at 12:36 PM, Tom Lane wrote: > Also, considering that this behavior has been there since 8.4, > I think it's sheerest chutzpah to claim that changing the docs in > v10 would materially reduce the backward-compatibility concerns > for whatever we might do in v11. > ​No it won'

Re: [HACKERS] Logical replication ApplyContext bloat

2017-05-09 Thread Stas Kelvich
> On 9 May 2017, at 21:53, Peter Eisentraut > wrote: > > On 5/8/17 11:26, Peter Eisentraut wrote: >> I think it would make more sense to reset ApplyMessageContext in >> apply_dispatch(), so that it is done consistently after every message >> (as the name implies), not only some messages. > > C

Re: [HACKERS] CTE inlining

2017-05-09 Thread Tom Lane
"David G. Johnston" writes: > On Tue, May 9, 2017 at 12:15 PM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: >> If we just tell them that the thing they might have relied on might go >> away, without a replacement to suggest, then we're just confusing and >> scaring them, no? > ​W

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
2017-05-09 21:23 GMT+02:00 Peter Eisentraut < peter.eisentr...@2ndquadrant.com>: > On 5/3/17 02:56, Pavel Stehule wrote: > > 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

Re: [HACKERS] CTE inlining

2017-05-09 Thread Serge Rielau
On Tue, May 9, 2017 at 12:22 PM, David G. Johnston wrote: On Tue, May 9, 2017 at 12:15 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com [peter.eisentr...@2ndquadrant.com] > wrote: On 5/5/17 08:43, David Rowley wrote: > How about we get the ball rolling on this in v10 and pull that part >

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread Tom Lane
David Fetter writes: > On Tue, May 09, 2017 at 12:48:01PM -0400, Tom Lane wrote: >> I don't think that's a problem: while psql will remove "--" and everything >> following it until newline, it won't remove the newline. So there's still >> a token boundary there. > We may still need to be careful

Re: [HACKERS] CTE inlining

2017-05-09 Thread David G. Johnston
On Tue, May 9, 2017 at 12:15 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 5/5/17 08:43, David Rowley wrote: > > How about we get the ball rolling on this in v10 and pull that part > > out of the docs. If anything that'll buy us a bit more wiggle room to > > change this in v

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Peter Eisentraut
On 5/3/17 02:56, Pavel Stehule wrote: > 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 > >

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread David Fetter
On Tue, May 09, 2017 at 12:48:01PM -0400, Tom Lane wrote: > David Fetter writes: > > On Fri, May 05, 2017 at 02:20:26PM -0400, Robert Haas wrote: > >> On Thu, May 4, 2017 at 10:59 AM, Chapman Flack > >> wrote: > >>> invalid input syntax for integer: "21' && 1=2)) Uni/**/ON > >>> SEl/**/eCT 0x646

Re: [HACKERS] CTE inlining

2017-05-09 Thread Peter Eisentraut
On 5/5/17 08:43, David Rowley wrote: > How about we get the ball rolling on this in v10 and pull that part > out of the docs. If anything that'll buy us a bit more wiggle room to > change this in v11. > > I've attached a proposed patch. If we just tell them that the thing they might have relied o

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
2017-05-09 20:37 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > [...] it is little bit worse. I cannot to distinguish between SELECT\gdesc >> and TRUNCATE xxx\gdesc . All are valid commands and produce empty result, >> so result of \gdesc command should be empty result too. >> >> postgres=# trunca

Re: [HACKERS] snapbuild woes

2017-05-09 Thread Petr Jelinek
On 09/05/17 19:54, Erik Rijkers wrote: > On 2017-05-09 11:50, Petr Jelinek wrote: > >> I rebased the above mentioned patch to apply to the patches Andres sent, >> if you could try to add it on top of what you have and check if it still >> fails, that would be helpful. > > It still fails. > > Wit

Re: [HACKERS] Logical replication ApplyContext bloat

2017-05-09 Thread Peter Eisentraut
On 5/8/17 11:26, Peter Eisentraut wrote: > I think it would make more sense to reset ApplyMessageContext in > apply_dispatch(), so that it is done consistently after every message > (as the name implies), not only some messages. Committed that. > Also, perhaps ApplyMessageContext should be a chil

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Fabien COELHO
Hello Pavel, [...] it is little bit worse. I cannot to distinguish between SELECT\gdesc and TRUNCATE xxx\gdesc . All are valid commands and produce empty result, so result of \gdesc command should be empty result too. postgres=# truncate table xx\gdesc ┌──┬──┐ │ Name │ Type │ ╞══

Re: [HACKERS] COMPRESS VALUES feature request

2017-05-09 Thread Marko Tiikkaja
On Tue, May 9, 2017 at 8:18 PM, Erez Segal wrote: > In the IRC channel - johto suggested an implementation: > > if you want to get really fancy you could have two columns where > only one of set; one would be the value (if reasonably unique) and the > other the id (if not) > I only suggested ho

Re: [HACKERS] CTE inlining

2017-05-09 Thread Ilya Shkuratov
Ok, it seems that most people in discussion are agree that removing optimization fence is a right thing to do. But so far the main topic was whether it worth to make "inlining" by default, and how we should enable it. Nonetheless I still hoping to discuss the algorithm and its implementation.

[HACKERS] COMPRESS VALUES feature request

2017-05-09 Thread Erez Segal
Hi, Following a discussion in the IRC channel, I'd like to suggest a feature request to the ToDo WIKI page . The use case is having a column with strings/floats, where some values are very common and can be compressed, while many other values are unique, mak

Re: [HACKERS] logical replication deranged sender

2017-05-09 Thread Petr Jelinek
On 09/05/17 19:13, Jeff Janes wrote: > On Tue, May 9, 2017 at 9:18 AM, Petr Jelinek > mailto:petr.jeli...@2ndquadrant.com>> wrote: > > On 08/05/17 13:47, Petr Jelinek wrote: > > On 08/05/17 01:17, Jeff Janes wrote: > >> After dropping a subscription, it says it succeeded and that it dr

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
2017-05-09 18:15 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > Patch applies cleanly and compiles. >>> >> > Idem for v2. "make check" ok. Tests look good. > > I would suggest some rewording, maybe: >>> >>> "Show the description of the result of the current query buffer without >>> actually execut

Re: [HACKERS] snapbuild woes

2017-05-09 Thread Erik Rijkers
On 2017-05-09 11:50, Petr Jelinek wrote: I rebased the above mentioned patch to apply to the patches Andres sent, if you could try to add it on top of what you have and check if it still fails, that would be helpful. It still fails. With these patches - 0001-WIP-Fix-off-by-one-around-GetLa

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-05-09 Thread Masahiko Sawada
On Mon, May 8, 2017 at 8:42 PM, Petr Jelinek wrote: > On 08/05/17 11:27, Masahiko Sawada wrote: >> Hi, >> >> I encountered a situation where DROP SUBSCRIPTION got stuck when >> initial table sync is in progress. In my environment, I created >> several tables with some data on publisher. I created

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread Mark Dilger
> On May 9, 2017, at 9:48 AM, Tom Lane wrote: > > David Fetter writes: >> On Fri, May 05, 2017 at 02:20:26PM -0400, Robert Haas wrote: >>> On Thu, May 4, 2017 at 10:59 AM, Chapman Flack >>> wrote: invalid input syntax for integer: "21' && 1=2)) Uni/**/ON SEl/**/eCT 0x646665743166657

Re: [HACKERS] logical replication deranged sender

2017-05-09 Thread Jeff Janes
On Tue, May 9, 2017 at 9:18 AM, Petr Jelinek wrote: > On 08/05/17 13:47, Petr Jelinek wrote: > > On 08/05/17 01:17, Jeff Janes wrote: > >> After dropping a subscription, it says it succeeded and that it dropped > >> the slot on the publisher. > >> > >> But the publisher still has the slot, and a

Re: [HACKERS] MSVC odd TAP test problem

2017-05-09 Thread Andrew Dunstan
On 05/06/2017 08:54 PM, Andrew Dunstan wrote: > > On 05/06/2017 07:41 PM, Craig Ringer wrote: >> >> On 7 May 2017 4:24 am, "Andrew Dunstan" >> > > wrote: >> >> >> I have been working on enabling the remaining TAP tests on MSVC >> build in >> the

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

2017-05-09 Thread Robert Haas
On Tue, May 9, 2017 at 9:26 AM, Rahila Syed wrote: >>Hi Rahila, > >>I am not able add a new partition if default partition is further >> partitioned >>with default partition. > >>Consider example below: > >>postgres=# CREATE TABLE test ( a int, b int, c int) PARTITION BY LIST (a); >>CREATE TABLE >

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread Tom Lane
David Fetter writes: > On Fri, May 05, 2017 at 02:20:26PM -0400, Robert Haas wrote: >> On Thu, May 4, 2017 at 10:59 AM, Chapman Flack wrote: >>> invalid input syntax for integer: "21' && 1=2)) Uni/**/ON >>> SEl/**/eCT 0x646665743166657274,0x646665743266657274, >>> 0x646665743366657274 -- " >> No

Re: [HACKERS] Should pg_current_wal_location() become pg_current_wal_lsn()

2017-05-09 Thread David Steele
On 5/9/17 10:00 AM, Stephen Frost wrote: * Tom Lane (t...@sss.pgh.pa.us) wrote: #2: Rename all these functions and columns to "lsn", as in this patch. +1 <...> #2 strikes me as the best option, though that's probably not much of a surprise to anyone whose been following my comments on thi

Re: [HACKERS] logical replication deranged sender

2017-05-09 Thread Petr Jelinek
On 08/05/17 13:47, Petr Jelinek wrote: > On 08/05/17 01:17, Jeff Janes wrote: >> After dropping a subscription, it says it succeeded and that it dropped >> the slot on the publisher. >> >> But the publisher still has the slot, and a full-tilt process described >> by ps as >> >> postgres: wal sende

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Fabien COELHO
Hello Pavel, Patch applies cleanly and compiles. Idem for v2. "make check" ok. Tests look good. I would suggest some rewording, maybe: "Show the description of the result of the current query buffer without actually executing it, by considering it a prepared statement." done Ok. If som

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

2017-05-09 Thread Petr Jelinek
On 09/05/17 16:28, Peter Eisentraut wrote: > On 5/9/17 04:39, Petr Jelinek wrote: What we want to simulate instead is an "auto" dependency of the slot on the subscription. So you can drop the slot separately (subject to other restrictions), and it is dropped automatically when the s

[HACKERS] export import bytea from psql

2017-05-09 Thread Pavel Stehule
Hi This is topic, that I try to solve some longer time. I would to open discussion before summer commitfest. The work with binary data or long text fields (multilines) or long not only utf8 encoded XML is not well supported by psql console. Is not hard to use binary protocol and write custom appl

Re: [HACKERS] SUBSCRIPTIONS and pg_upgrade

2017-05-09 Thread Peter Eisentraut
On 5/9/17 04:54, Petr Jelinek wrote: >> I think that it would be nice to fix that even before beta, so >> attached is a patch to add --no-subscriptions to pg_dump, pg_dumpall >> and pg_restore. > > Looks okay to me, it's simple enough patch. Committed, thanks. (There was some inconsistent variab

Re: [HACKERS] idea: custom log_line_prefix components besides application_name

2017-05-09 Thread David Fetter
On Fri, May 05, 2017 at 02:20:26PM -0400, Robert Haas wrote: > On Thu, May 4, 2017 at 10:59 AM, Chapman Flack wrote: > > invalid input syntax for integer: "21' && 1=2)) Uni/**/ON > > SEl/**/eCT 0x646665743166657274,0x646665743266657274, > > 0x646665743366657274 -- " > > Now that is choice. I won

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

2017-05-09 Thread Peter Eisentraut
On 5/9/17 03:27, Masahiko Sawada wrote: > I think we should change tab-completion support for that as well. > > diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c > index 183fc37..046fdd5 100644 > --- a/src/bin/psql/tab-complete.c > +++ b/src/bin/psql/tab-complete.c > @@ -2684,

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

2017-05-09 Thread Peter Eisentraut
On 5/9/17 04:39, Petr Jelinek wrote: >>> What we want to simulate instead is an "auto" dependency of the slot on >>> the subscription. So you can drop the slot separately (subject to other >>> restrictions), and it is dropped automatically when the subscription is >>> dropped. To avoid that, you

Re: [HACKERS] Should pg_current_wal_location() become pg_current_wal_lsn()

2017-05-09 Thread Stephen Frost
Tom, all, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Peter Eisentraut writes: > > On 5/1/17 08:10, David Rowley wrote: > >> OK, so I've created a draft patch which does this. > > > After reading this patch, I see that > > a) The scope of the compatibility break is expanded significantly beyond > >

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-05-09 Thread Mark Dilger
> On May 9, 2017, at 12:18 AM, Amit Langote > wrote: > > Hi, > > On 2017/05/05 9:38, Mark Dilger wrote: >> Hackers, >> >> just FYI, I cannot find any regression test coverage of this part of the >> grammar, not >> even in the contrib/ directory or TAP tests. I was going to submit a patch >

Re: [HACKERS] Should pg_current_wal_location() become pg_current_wal_lsn()

2017-05-09 Thread Tom Lane
Peter Eisentraut writes: > On 5/1/17 08:10, David Rowley wrote: >> OK, so I've created a draft patch which does this. > After reading this patch, I see that > a) The scope of the compatibility break is expanded significantly beyond > what was already affected by the xlog->wal renaming. > b) Gener

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

2017-05-09 Thread Rahila Syed
>Hi Rahila, >I am not able add a new partition if default partition is further partitioned >with default partition. >Consider example below: >postgres=# CREATE TABLE test ( a int, b int, c int) PARTITION BY LIST (a); >CREATE TABLE >postgres=# CREATE TABLE test_p1 PARTITION OF test FOR VALUES IN(

Re: [HACKERS] Bug in pg_dump --table and --exclude-table for declarative partition table handling.

2017-05-09 Thread amul sul
On Tue, May 9, 2017 at 3:51 PM, Ashutosh Bapat wrote: > On Tue, May 9, 2017 at 2:59 PM, Amit Langote > wrote: >> Hi Amul, >> >> On 2017/05/09 16:13, amul sul wrote: >>> Hi, >>> >>> Current pg_dump --exclude-table option excludes partitioned relation >>> and dumps all its child relations and vice

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-05-09 Thread Ashutosh Bapat
On Tue, May 9, 2017 at 12:48 PM, Amit Langote wrote: > Hi, > > On 2017/05/05 9:38, Mark Dilger wrote: >> Hackers, >> >> just FYI, I cannot find any regression test coverage of this part of the >> grammar, not >> even in the contrib/ directory or TAP tests. I was going to submit a patch >> to he

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

2017-05-09 Thread Thomas Munro
On Mon, May 8, 2017 at 7:09 PM, Thomas Munro wrote: > On Fri, May 5, 2017 at 8:29 AM, Thomas Munro > wrote: >> On Fri, May 5, 2017 at 2:40 AM, Robert Haas wrote: >>> On Thu, May 4, 2017 at 4:46 AM, Thomas Munro >>> wrote: On Thu, May 4, 2017 at 4:02 AM, Alvaro Herrera wrote: > R

Re: [HACKERS] snapbuild woes

2017-05-09 Thread Erik Rijkers
On 2017-05-09 11:50, Petr Jelinek wrote: On 09/05/17 10:59, Erik Rijkers wrote: On 2017-05-09 10:50, Petr Jelinek wrote: On 09/05/17 00:03, Erik Rijkers wrote: On 2017-05-05 02:00, Andres Freund wrote: Could you have a look? [...] I rebased the above mentioned patch to apply to the patche

[HACKERS] [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-05-09 Thread Mengxing Liu
Hi, Alvaro and Kevin. I'm Mengxing. This is a “synchronization” email to tell you what I've done and my next plan. I'm looking forward to your advice. According to my proposal, I want to prepare the experimental environment during the community bonding period. As this is the first tim

Re: [HACKERS] Bug in pg_dump --table and --exclude-table for declarative partition table handling.

2017-05-09 Thread Ashutosh Bapat
On Tue, May 9, 2017 at 2:59 PM, Amit Langote wrote: > Hi Amul, > > On 2017/05/09 16:13, amul sul wrote: >> Hi, >> >> Current pg_dump --exclude-table option excludes partitioned relation >> and dumps all its child relations and vice versa for --table option, which >> I think is incorrect. > > I agr

Re: [HACKERS] Bug in pg_dump --table and --exclude-table for declarative partition table handling.

2017-05-09 Thread Jeevan Ladhe
Hi Amit, Ashutosh, On Tue, May 9, 2017 at 3:29 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Tue, May 9, 2017 at 3:13 PM, Amit Langote > wrote: > > On 2017/05/09 17:21, Jeevan Ladhe wrote: > >> On Tue, May 9, 2017 at 12:43 PM, amul sul wrote: > >>> Current pg_dump --exclude-

[HACKERS] Issues with replication slots(which created manually) against logical replication

2017-05-09 Thread tushar
Hi, While testing 'logical replication' against v10 , i encountered couple of issue when created logical/physical slot manually. Case 1 - when used with logical replication slot (which created manually) Publication Server(X) \\ Make sure wal_level is set to logical in postgresql.conf file \\

Re: [HACKERS] Bug in pg_dump --table and --exclude-table for declarative partition table handling.

2017-05-09 Thread Ashutosh Bapat
On Tue, May 9, 2017 at 3:13 PM, Amit Langote wrote: > On 2017/05/09 17:21, Jeevan Ladhe wrote: >> On Tue, May 9, 2017 at 12:43 PM, amul sul wrote: >>> Current pg_dump --exclude-table option excludes partitioned relation >>> and dumps all its child relations and vice versa for --table option, whic

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

2017-05-09 Thread Petr Jelinek
On 09/05/17 11:44, Masahiko Sawada wrote: > On Tue, May 9, 2017 at 5:57 PM, Petr Jelinek > wrote: >> On 09/05/17 10:51, Masahiko Sawada wrote: >>> On Tue, May 9, 2017 at 5:39 PM, Petr Jelinek >>> wrote: On 09/05/17 07:07, Peter Eisentraut wrote: > On 5/8/17 23:23, Peter Eisentraut wrote:

Re: [HACKERS] snapbuild woes

2017-05-09 Thread Petr Jelinek
On 09/05/17 10:59, Erik Rijkers wrote: > On 2017-05-09 10:50, Petr Jelinek wrote: >> On 09/05/17 00:03, Erik Rijkers wrote: >>> On 2017-05-05 02:00, Andres Freund wrote: Could you have a look? >>> >>> Running tests with these three patches: >>> 0001-WIP-Fix-off-by-one-around-GetLastI

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

2017-05-09 Thread Masahiko Sawada
On Tue, May 9, 2017 at 5:57 PM, Petr Jelinek wrote: > On 09/05/17 10:51, Masahiko Sawada wrote: >> On Tue, May 9, 2017 at 5:39 PM, Petr Jelinek >> wrote: >>> On 09/05/17 07:07, Peter Eisentraut wrote: On 5/8/17 23:23, Peter Eisentraut wrote: > The way this uses RESTRICT and CASCADE appea

  1   2   >