Re: [HACKERS] Bug in to_timestamp().

2018-02-12 Thread Arthur Zakirov
Hello, On Fri, Feb 09, 2018 at 04:31:14PM +0100, Dmitry Dolgov wrote: > I went through this thread, and want to summarize a bit: > > From what I see this patch addresses most important concerns that were > mentioned in the thread, i.e. to make `to_timestamp` less confusing and be > close to

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-02-12 Thread Pavan Deolasee
On Fri, Feb 2, 2018 at 9:07 PM, Robert Haas wrote: > On Thu, Feb 1, 2018 at 7:21 PM, Simon Riggs wrote: > > Yes, it would be about 99% of the time. > > > > But you have it backwards - we are not assuming that case. That is the > > only case that has

Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-02-12 Thread Rajkumar Raghuwanshi
Hi, I am getting "ERROR: unexpected expression in subquery output" and "ERROR: variable not found in subplan target lists" errors, for "FOR UPDATE" with postgres_fdw. (when set enable_partition_wise_join to true); Attached patch have queries which are throwing mentioned error on running make

Re: Server won't start with fallback setting by initdb.

2018-02-12 Thread Michael Paquier
On Fri, Feb 09, 2018 at 05:08:23PM +0900, Kyotaro HORIGUCHI wrote: > > postgres: max_wal_senders must be less than max_connections > > I think that we can safely increase the fallback value to 20 with > which regtests are known not to fail. I believe that is > preferable than explicitly reducing

Re: csv format for psql

2018-02-12 Thread Daniel Verite
Pavel Stehule wrote: > > I guess -C/--csv could be used, like there already is -H/--html. > > > > I prefer just long option only. Maybe in future we can use short "C" for > something else better. There is only few free short commands. Looking at parse_psql_options(), currently psql has

Re: Parallel bt build crashes when DSM_NONE

2018-02-12 Thread Michael Paquier
On Fri, Feb 09, 2018 at 05:06:35PM +0900, Kyotaro HORIGUCHI wrote: > I happend to find that server crashes during regtest when > DSM_NONE is enforced. The attached patch fixes that. > > The cause is the fact that _bt_spools_heapscan runs > _bt_begin_parallel() even if dynamic_shared_memory_type

Re: ldapi support

2018-02-12 Thread Peter Eisentraut
On 2/10/18 19:46, Michael Paquier wrote: > On Fri, Feb 09, 2018 at 08:44:38PM -0500, Peter Eisentraut wrote: >> Hmm. I think the ldap test suite should be changed to use >> $node->restart instead of $node->reload, so we can be sure that the >> various pg_hba.conf lines are actually accepted. It

Re: csv format for psql

2018-02-12 Thread Daniel Verite
Pavel Stehule wrote: > some like "\pset format csv , header_off If we did that, we'd need to reconsider the interactions of this with \t on|off and \pset footer on|off and how to keep things consistent with the unaligned format. I feel like it's not worth the trouble. We can still add

Re: Minor version upgrades and extension packaging

2018-02-12 Thread Peter Eisentraut
On 2/11/18 23:14, Andres Freund wrote: > On 2018-02-11 22:19:30 -0500, Tom Lane wrote: >> Not sure what to do about it at this point. We could move that field to >> the end for 10.3, leaving 10.2 as the only ABI-incompatible minor release, >> but I don't know that that really makes things any

Re: csv format for psql

2018-02-12 Thread Pavel Stehule
2018-02-12 15:33 GMT+01:00 Daniel Verite : > Pavel Stehule wrote: > > > some like "\pset format csv , header_off > > If we did that, we'd need to reconsider the interactions > of this with \t on|off and \pset footer on|off > and how to keep things consistent with

Re: Bogosities in pg_dump's extended statistics support

2018-02-12 Thread Alvaro Herrera
Thanks for patching. Your points #1, #2 and #4 are OK with me. I'm thinking about point #3, concerning when-to-dump policy for stats objects: Tom Lane wrote: > 3. pg_dump decides whether to dump a stats object on the basis of whether > its underlying table is going to be dumped. While that's

Re: Minor version upgrades and extension packaging

2018-02-12 Thread Mat Arye
On Mon, Feb 12, 2018 at 8:41 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2/11/18 23:14, Andres Freund wrote: > > On 2018-02-11 22:19:30 -0500, Tom Lane wrote: > >> Not sure what to do about it at this point. We could move that field to > >> the end for 10.3, leaving 10.2

Re: CALL stmt, ERROR: unrecognized node type: 113 bug

2018-02-12 Thread Peter Eisentraut
On 2/1/18 11:33, Pavel Stehule wrote: > postgres=# \sf test > ERROR:  cache lookup failed for type 0 Here is a patch set that adds procedure support to \ef and \sf. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: CALL stmt, ERROR: unrecognized node type: 113 bug

2018-02-12 Thread Peter Eisentraut
On 2/11/18 01:10, Tom Lane wrote: >> This brings the amount of objects stored in pg_proc to four. Perhaps it >> would be time to bring more clarity in pg_proc by introducing a prokind >> column for functions, aggregates, window functions and procedures? > > Yeah. I was under the impression that

Re: Bogosities in pg_dump's extended statistics support

2018-02-12 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> I propose that we should just treat extended stats objects like other >> generic database objects --- which, in practice, means "dump if the >> containing schema is getting dumped". We don't exclude views or matviews >> on the

Re: Bogosities in pg_dump's extended statistics support

2018-02-12 Thread Robert Haas
On Mon, Feb 12, 2018 at 10:07 AM, Alvaro Herrera wrote: > The followup question is what to do for multi-table stats objects. I > think the options are that it should be dumped if: > > 1. any of its tables are dumped > 2. *all* its tables are dumped > 3. the schema

RE: [HACKERS] Client Connection redirection support for PostgreSQL

2018-02-12 Thread Satyanarayana Narlapuram
I simplified the patch and for now just allowed one server. Please find the attached patches, and the commit message. Thanks, Satya -Original Message- From: Robert Haas Sent: Monday, November 6, 2017 5:56 AM To: Craig Ringer Cc:

Re: Minor version upgrades and extension packaging

2018-02-12 Thread David Fetter
On Mon, Feb 12, 2018 at 01:04:40PM -0500, Mat Arye wrote: > On Mon, Feb 12, 2018 at 8:41 AM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: > > > On 2/11/18 23:14, Andres Freund wrote: > > > On 2018-02-11 22:19:30 -0500, Tom Lane wrote: > > >> Not sure what to do about it at this

Re: Parallel bt build crashes when DSM_NONE

2018-02-12 Thread Robert Haas
On Mon, Feb 12, 2018 at 12:26 PM, Peter Geoghegan wrote: > I think that your patch does the right thing. > plan_create_index_workers() is supposed to take care of parallel > safety, and this is a parallel safety issue. Committed the patch. -- Robert Haas EnterpriseDB:

Re: CALL stmt, ERROR: unrecognized node type: 113 bug

2018-02-12 Thread Pavel Stehule
2018-02-12 18:17 GMT+01:00 Peter Eisentraut < peter.eisentr...@2ndquadrant.com>: > On 2/9/18 09:42, Tom Lane wrote: > > Meh. It doesn't look significantly different to me than the restriction > > that you can't have sub-selects in CHECK expressions, index expressions, > > etc. Obviously we need

Re: CALL stmt, ERROR: unrecognized node type: 113 bug

2018-02-12 Thread Peter Eisentraut
On 2/9/18 09:42, Tom Lane wrote: > Meh. It doesn't look significantly different to me than the restriction > that you can't have sub-selects in CHECK expressions, index expressions, > etc. Obviously we need a clean failure like you get for those cases. > But otherwise it's an OK restriction that

Re: [HACKERS] logical decoding of two-phase transactions

2018-02-12 Thread Andres Freund
Hi, On 2018-02-12 13:36:16 +0530, Nikhil Sontakke wrote: > Hi Andres, > > > First off: This patch has way too many different types of changes as > > part of one huge commit. This needs to be split into several > > pieces. First the cleanups (e.g. the fields -> flag changes), then the > >

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Joe Conway
On 02/11/2018 10:06 PM, Thomas Munro wrote: > On Mon, Feb 12, 2018 at 12:24 PM, Andrew Dunstan > wrote: >> On Mon, Feb 12, 2018 at 9:10 AM, Tom Lane wrote: >>> Andrew Kane writes: A better option could be a new

Re: Minor version upgrades and extension packaging

2018-02-12 Thread Alvaro Herrera
Andres Freund wrote: > Ugh. I personally would say that's because that commit did stuff that we > normally trie hard not to do. While ColumnDef at least isn't serialized > into catalogs, we normally trie hard to break struct layout. Peter, > shouldn't that field at the very least have been added

Re: CALL stmt, ERROR: unrecognized node type: 113 bug

2018-02-12 Thread Tom Lane
Peter Eisentraut writes: > On 2/1/18 11:33, Pavel Stehule wrote: >> postgres=# \sf test >> ERROR:  cache lookup failed for type 0 > Here is a patch set that adds procedure support to \ef and \sf. I've not read in detail, but it looks reasonable offhand, modulo

Re: Removing shm_mq.c's volatile qualifiers

2018-02-12 Thread Thomas Munro
On Tue, Feb 13, 2018 at 9:09 AM, Robert Haas wrote: > On Sun, Feb 11, 2018 at 6:52 PM, Thomas Munro > wrote: >> As far as I can see, all the volatile qualifiers in shm_mq.c have been >> redundant since ec9037df263. > > That's the commit that

Re: CALL stmt, ERROR: unrecognized node type: 113 bug

2018-02-12 Thread Tom Lane
Peter Eisentraut writes: > On 2/11/18 01:10, Tom Lane wrote: >> Yeah. I was under the impression that Peter was looking into that ... >> [ digs... ] see >> https://www.postgresql.org/message-id/80ee1f5c-fa9d-7285-ed07-cff53d4f4...@2ndquadrant.com > Yeah that's

Re: Cancelling parallel query leads to segfault

2018-02-12 Thread Peter Eisentraut
On 2/6/18 12:06, Andres Freund wrote: > On 2018-02-06 12:01:08 -0500, Peter Eisentraut wrote: >> On 2/1/18 20:35, Andres Freund wrote: >>> On February 1, 2018 11:13:06 PM GMT+01:00, Peter Eisentraut >>> wrote: Here is a patch to implement that idea. Do you

Re: rename sgml files?

2018-02-12 Thread Tom Lane
Peter Eisentraut writes: > So, should we rename the *.sgml files to *.xml, since they are actually > now XML files? At that point, back-patching documentation fixes would become effectively impossible except through manual intervention in the patching process. I

Re: Removing shm_mq.c's volatile qualifiers

2018-02-12 Thread Robert Haas
On Sun, Feb 11, 2018 at 6:52 PM, Thomas Munro wrote: > As far as I can see, all the volatile qualifiers in shm_mq.c have been > redundant since ec9037df263. That's the commit that added shm_mq.c. ITYM 0709b7ee as you said in the commit message -- Robert Haas

Re: unique indexes on partitioned tables

2018-02-12 Thread Alvaro Herrera
Hello, Thanks, Peter, Jesper, Amit, for reviewing the patch. Replying to all review comments at once: Jesper Pedersen wrote: > Maybe add a test case to indexing.sql that highlights that hash indexes > doesn't support UNIQUE; although not unique to partitioned indexes. I'm not sure about this.

Re: Using scalar function as set-returning: bug or feature?

2018-02-12 Thread Tom Lane
Pavel Stehule writes: > 2018-02-09 12:02 GMT+01:00 Marko Tiikkaja : >> This is quite short-sighted. The better way to do this is to complain if >> the number of expressions is different from the number of target variables >> (and the target variable is not

Re: [HACKERS] MERGE SQL Statement for PG11

2018-02-12 Thread Pavan Deolasee
On Fri, Feb 9, 2018 at 8:06 PM, Robert Haas wrote: > > > On that basis, of the options I listed in > http://postgr.es/m/CA+TgmoZDL-caukHkWet7sr7sqr0-e2T91+ > devhqen5sfqsm...@mail.gmail.com > I like #1 least. > > I also dislike #4 from that list for the reasons stated

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Mark Dilger
> On Feb 12, 2018, at 5:08 PM, Andrew Kane wrote: > > Thanks everyone for the feedback. The current enum implementation requires > you to create a new type and add labels outside a transaction prior to an > insert. > > -- on table creation > CREATE TYPE city AS ENUM ();

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Mark Dilger
> On Feb 12, 2018, at 6:35 PM, Tom Lane wrote: > > Andrew Kane writes: >> Thanks everyone for the feedback. The current enum implementation requires >> you to create a new type and add labels outside a transaction prior to an >> insert. > > Right ...

Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support

2018-02-12 Thread Peter Eisentraut
I would like to see a global setting of some kind that specifies which extra tests are allowed to be run. This could be a configure argument or an environment/make variable. Rather than make it a list of tests, specify which facilities you have available, e.g., PG_EXTRA_TEST_FACILTITIES='tcpip

Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patch for hash index

2018-02-12 Thread Amit Kapila
On Sun, Jan 28, 2018 at 7:28 AM, Amit Kapila wrote: > On Thu, Jan 25, 2018 at 7:29 PM, Alexander Korotkov > wrote: >>> As Shubham seems to be running out of time, I thought of helping him >>> by looking into the above-suggested idea. I think

Re: Typo in origin.c

2018-02-12 Thread Peter Eisentraut
On 2/12/18 21:58, Masahiko Sawada wrote: > Attached a patch for fixing $subject. > > s/funcion/function/ fixed -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: rename sgml files?

2018-02-12 Thread Tatsuo Ishii
> My vote would be to backport the build changes to v10, which should be > simple enough, and wait for 9.6 to be EOL'd before doing the rename. Me too. However my concern is the tool chain. Maybe we should notice packagers to prepare it? Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English:

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Andrew Kane
They'd refer to separate enums. I originally thought an enum was a good comparison for this feature, but I'm no longer sure that it is. A text-based ordering would be desired rather than the label index. A better comparison may be a two-column lookup table: -- create CREATE TABLE cities (id

Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support

2018-02-12 Thread Michael Paquier
On Mon, Feb 12, 2018 at 10:22:13PM -0500, Peter Eisentraut wrote: > I would like to see a global setting of some kind that specifies which > extra tests are allowed to be run. This could be a configure argument > or an environment/make variable. Rather than make it a list of tests, > specify

Re: rename sgml files?

2018-02-12 Thread Michael Paquier
On Tue, Feb 13, 2018 at 12:58:22PM +0900, Tatsuo Ishii wrote: >> My vote would be to backport the build changes to v10, which should be >> simple enough, and wait for 9.6 to be EOL'd before doing the rename. > > Me too. However my concern is the tool chain. Maybe we should notice > packagers to

Re: rename sgml files?

2018-02-12 Thread Tom Lane
David Fetter writes: > On Mon, Feb 12, 2018 at 04:19:48PM -0500, Tom Lane wrote: >> As I've remarked before, the issue would disappear if we were to >> back-patch the XML-ization of the documentation. So I'd be fine >> with this if we did it uniformly in the supported branches.

Re: non-bulk inserts and tuple routing

2018-02-12 Thread Amit Langote
Fujita-san, Thanks for the review. On 2018/02/09 21:20, Etsuro Fujita wrote: >>> * Please add a brief decsription about partition_oids to the comments for >>> this struct. >>> >>> @@ -91,6 +91,7 @@ typedef struct PartitionTupleRouting >>>   { >>> PartitionDispatch *partition_dispatch_info;

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Andrew Kane
Thanks everyone for the feedback. The current enum implementation requires you to create a new type and add labels outside a transaction prior to an insert. -- on table creation CREATE TYPE city AS ENUM (); CREATE TABLE "users" ("city" city); -- on insert ALTER TYPE city ADD VALUE IF NOT EXISTS

Re: PostgreSQL crashes with SIGSEGV

2018-02-12 Thread Peter Geoghegan
On Wed, Feb 7, 2018 at 7:02 PM, Peter Geoghegan wrote: > On Wed, Feb 7, 2018 at 4:41 PM, Tom Lane wrote: >> Peter Geoghegan writes: >>> It would be nice to get an opinion on this mode_final() + tuplesort >>> memory lifetime business from you, Tom.

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Tom Lane
Andrew Kane writes: > Thanks everyone for the feedback. The current enum implementation requires > you to create a new type and add labels outside a transaction prior to an > insert. Right ... > Since enums have a fixed number of labels, this type of feature may be >

Re: pgsql: Local partitioned indexes

2018-02-12 Thread Amit Langote
On 2018/02/10 23:32, Amit Langote wrote: > On Sat, Feb 10, 2018 at 10:09 PM, Alvaro Herrera > wrote: >> Amit Langote wrote: >>> On 2018/01/19 23:55, Alvaro Herrera wrote: Local partitioned indexes >> >>> I noticed that the declarative partitioning section in ddl.sgml

Typo in origin.c

2018-02-12 Thread Masahiko Sawada
Hi, Attached a patch for fixing $subject. s/funcion/function/ Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center fix_typo_in_origin_c.patch Description: Binary data

Re: In logical replication concurrent update of partition key creates a duplicate record on standby.

2018-02-12 Thread Peter Eisentraut
On 2/8/18 10:54, amul sul wrote: > Not really, like ExecUpdate for an update of partition key if delete is failed > then the further insert will be skipped, but you are correct, it might be more > tricky than I can think -- there is no guarantee that the next insert > operation > which

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Mark Dilger
> On Feb 10, 2018, at 7:46 PM, Andrew Kane wrote: > > Hi, > > I'm hoping to get feedback on an idea for a new data type to allow for > efficient storage of text values while keeping reads and writes > user-friendly. Suppose you want to store categorical data like

Re: rename sgml files?

2018-02-12 Thread David Fetter
On Mon, Feb 12, 2018 at 04:19:48PM -0500, Tom Lane wrote: > Peter Eisentraut writes: > > So, should we rename the *.sgml files to *.xml, since they are actually > > now XML files? > > At that point, back-patching documentation fixes would become effectively >

Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support

2018-02-12 Thread Andrew Dunstan
On Sat, Feb 10, 2018 at 2:02 PM, Thomas Munro wrote: > I agree that it would be nice if the build farm (and my unofficial > patch tester for that matter) could automatically test the LDAP stuff > when running on a suitable system, but I think it would need to be >

Re: Using scalar function as set-returning: bug or feature?

2018-02-12 Thread Tom Lane
I wrote: > I think the issue basically arises from this concern in exec_move_row: > * NOTE: this code used to demand row->nfields == > * HeapTupleHeaderGetNatts(tup->t_data), but that's wrong. The tuple > * might have more fields than we expected if it's from an > *

Re: [HACKERS] logical decoding of two-phase transactions

2018-02-12 Thread Nikhil Sontakke
Hi Andres, > First off: This patch has way too many different types of changes as > part of one huge commit. This needs to be split into several > pieces. First the cleanups (e.g. the fields -> flag changes), then the > individual infrastructure pieces (like the twophase.c changes, best > split

Re: A space-efficient, user-friendly way to store categorical data

2018-02-12 Thread Andres Freund
Hi, On 2018-02-12 09:54:29 +1030, Andrew Dunstan wrote: > The idea is to have an append-only list of labels > which would not obey transactional semantics, and would thus help us > avoid the pitfalls of enums - there wouldn't be any rollback of an > addition. FWIW, I think we can resolve the

Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patch for hash index

2018-02-12 Thread Thomas Munro
On Tue, Feb 13, 2018 at 4:28 PM, Amit Kapila wrote: > On Sun, Jan 28, 2018 at 7:28 AM, Amit Kapila wrote: >> On Thu, Jan 25, 2018 at 7:29 PM, Alexander Korotkov >> wrote: As Shubham seems to be running out of

Re: ALTER TABLE ADD COLUMN fast default

2018-02-12 Thread Andrew Dunstan
On Fri, Feb 9, 2018 at 3:54 PM, Andrew Dunstan wrote: > On Mon, Feb 5, 2018 at 7:49 AM, Andrew Dunstan > wrote: >> On Mon, Feb 5, 2018 at 7:19 AM, Thomas Munro >> wrote: >>> On Fri, Jan 26, 2018 at

Re: rename sgml files?

2018-02-12 Thread Tom Lane
Michael Paquier writes: > On Tue, Feb 13, 2018 at 12:58:22PM +0900, Tatsuo Ishii wrote: >>> My vote would be to backport the build changes to v10, which should be >>> simple enough, and wait for 9.6 to be EOL'd before doing the rename. >> Me too. However my concern is the

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-02-12 Thread amul sul
On Tue, Feb 13, 2018 at 11:32 AM, Amit Kapila wrote: > On Wed, Feb 7, 2018 at 6:13 PM, amul sul wrote: >> On Tue, Feb 6, 2018 at 7:05 PM, amul sul wrote: >>> On Sun, Feb 4, 2018 at 10:47 AM, Amit Kapila

heap_lock_updated_tuple_rec can leak a buffer refcount

2018-02-12 Thread Amit Kapila
It seems to me that heap_lock_updated_tuple_rec can lead to a buffer refcount leak while locking an updated tuple by an aborted transaction. In commit - 5c609a74, we have added the code to deal with aborted transactions as below: heap_lock_updated_tuple_rec() { .. if

Re: In logical replication concurrent update of partition key creates a duplicate record on standby.

2018-02-12 Thread Amit Kapila
On Tue, Feb 13, 2018 at 5:25 AM, Peter Eisentraut wrote: > On 2/8/18 10:54, amul sul wrote: >> Not really, like ExecUpdate for an update of partition key if delete is >> failed >> then the further insert will be skipped, but you are correct, it might be >> more

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-02-12 Thread Amit Kapila
On Wed, Feb 7, 2018 at 6:13 PM, amul sul wrote: > On Tue, Feb 6, 2018 at 7:05 PM, amul sul wrote: >> On Sun, Feb 4, 2018 at 10:47 AM, Amit Kapila wrote: >> >> Yes, you are correct standby stopped with a following error: >> >>