[HACKERS] make default TABLESPACE belong to target table.

2016-11-24 Thread Amos Bird
Dear pgsql community, I've been using postgres for a long time. Recently I'm doing table sharding over a bunch of pgsql instances. I'm using multiple tablespaces one per disk to utilize all the IO bandwidth. Things went on pretty well, however there is a troublesome problem I have when adding

Re: [HACKERS] Parallel execution and prepared statements

2016-11-24 Thread Laurenz Albe
There has been a previous discussion about this topic, including an attempted fix by Amit Kapila: http://www.postgresql.org/message-id/flat/CAA4eK1L=tHmmHDK_KW_ja1_dusJxJF+SGQHi=aps4mdnpk7...@mail.gmail.com/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to

Re: [HACKERS] Forbid use of LF and CR characters in database and role names

2016-11-24 Thread Michael Paquier
On Fri, Nov 25, 2016 at 4:02 PM, Ideriha, Takeshi wrote: > I applied your fixed patch and new one, and confirmed the applied source > passed the tests successfully. And I also checked manually the error messages > were emitted successfully when cr/lf are included

[HACKERS] confusing checkpoint_flush_after / bgwriter_flush_after

2016-11-24 Thread Tomas Vondra
Hi, while doing some benchmarking, I've once again got confused by the default settings for checkpoint_flush_after and bgwriter_flush_after. The sample config says this: #checkpoint_flush_after = 0 # 0 disables, # default is 256kB on linux, 0 otherwise

Re: [HACKERS] Forbid use of LF and CR characters in database and role names

2016-11-24 Thread Ideriha, Takeshi
> > [Summary] > > 1. apply patch and make world > > -> failed because was mistakenly coded . > > > > 2.correct this mistake and make check-world > > -> got 1 failed test: "'pg_dumpall with \n\r in database name'" > > because test script cannot createdb "foo\n\rbar" > > The attached

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Pavel Stehule
2016-11-25 7:44 GMT+01:00 Pavel Stehule : > > > 2016-11-25 3:31 GMT+01:00 Alvaro Herrera : > >> Michael Paquier wrote: >> >> > Nit: I did not look at the patch in details, >> > but I find the size of the latest version sent, 167kB, scary as it >>

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Pavel Stehule
2016-11-25 3:31 GMT+01:00 Alvaro Herrera : > Michael Paquier wrote: > > > Nit: I did not look at the patch in details, > > but I find the size of the latest version sent, 167kB, scary as it > > complicates review and increases the likeliness of bugs. > > Here's the stat.

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Andreas Karlsson
On 11/25/2016 07:19 AM, Tsunakawa, Takayuki wrote: Specifying multiple hosts is a new feature to be introduced in v10, so that's here: https://www.postgresql.org/docs/devel/static/libpq-connect.html Thanks, I had missed that patch. If we add support for multiple hosts I think we should also

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org > sense to add support for multiple hostaddrs. For consitency's sake if > nothing else. Yes, consistency and performance. The purpose of hostaddr is to speed up connection by eliminating DNS lookup, isn't it? Then, some users should want to specify

Re: [HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Tom Lane
Craig Ringer writes: > PGDLLIMPORT is free, so the question should be "is there a reason not > to add it here?". TBH, my basic complaint about it is that I do not like Microsoft's tool chain assuming that it's entitled to demand that people sprinkle Microsoft-specific

Re: [HACKERS] IF (NOT) EXISTS in psql-completion

2016-11-24 Thread Kyotaro HORIGUCHI
Hello, At Fri, 25 Nov 2016 06:51:43 +0100, Pavel Stehule wrote in > I am sure about benefit of all patches - but it is lot of changes in one > moment, and it is not necessary in this moment. > >

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Mithun Cy
On Fri, Nov 25, 2016 at 10:41 AM, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > I agree that pg_conn_host should have hostaddr in addition to host, and PQhost() return host when host is specified with/without hostaddr specified. typedef struct pg_conn_host +{ *+ char *host; /*

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Pavel Stehule
2016-11-25 1:44 GMT+01:00 Robert Haas : > On Thu, Nov 24, 2016 at 6:20 PM, Pavel Stehule > wrote: > >> I think that the whole emphasis on whether and to what degree this is > >> like Oracle is somewhat misplaced. I would look at it a different >

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Andreas Karlsson
On 11/25/2016 06:11 AM, Tsunakawa, Takayuki wrote: However, I wonder whether the hostaddr parameter should also accept multiple IP addresses. Yeah, I too thought about if we should fix that. I feel like it would make sense to add support for multiple hostaddrs. For consitency's sake if

Re: [HACKERS] IF (NOT) EXISTS in psql-completion

2016-11-24 Thread Pavel Stehule
2016-11-25 2:24 GMT+01:00 Kyotaro HORIGUCHI : > Hello, > > Thank you for looking this long-and-bothersome patch. > > > At Wed, 23 Nov 2016 07:12:00 +0100, Pavel Stehule > wrote in vd9fgpsgv...@mail.gmail.com> > > Hi > > > > 2016-11-15

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Andreas Karlsson > On 11/24/2016 10:38 PM, Andreas Karlsson wrote: > > To me it feels like the proper fix would be to make PQHost() return > > the value of the host parameter rather than the

Re: [HACKERS] [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan

2016-11-24 Thread Tom Lane
Amit Kapila writes: > On Fri, Nov 25, 2016 at 3:26 AM, Andreas Seltenreich > wrote: >> just caught another InitPlan below Gather with the recent patches in >> (master as of 4cc6a3f). Recipe below. > I think this problem exists since commit >

Re: [HACKERS] Declarative partitioning - another take

2016-11-24 Thread Ashutosh Bapat
> > I assume you meant "...right after the column name"? > > I will modify the grammar to allow that way then, so that the following > will work: > > create table p1 partition of p ( > a primary key > ) for values in (1); > That seems to be non-intuitive as well. The way it's written it

Re: [HACKERS] [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan

2016-11-24 Thread Amit Kapila
On Fri, Nov 25, 2016 at 3:26 AM, Andreas Seltenreich wrote: > Hi, > > just caught another InitPlan below Gather with the recent patches in > (master as of 4cc6a3f). Recipe below. > I think this problem exists since commit 110a6dbdebebac9401b43a8fc223e6ec43cd4d10 where we

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Michael Paquier
On Fri, Nov 25, 2016 at 8:15 AM, Andreas Karlsson wrote: > On 11/24/2016 10:38 PM, Andreas Karlsson wrote: >> To me it feels like the proper fix would be to make PQHost() return the >> value of the host parameter rather than the hostaddr (maybe add a new >> field in the

Re: [HACKERS] Declarative partitioning - another take

2016-11-24 Thread Alvaro Herrera
Amit Langote wrote: > On 2016/11/25 4:36, Alvaro Herrera wrote: > > I think CREATE TABLE OF is pretty much a corner case. I agree that > > allowing the constraint right after the constraint name is more > > intuitive. > > I assume you meant "...right after the column name"? Eh, right. --

[HACKERS] Typo in comment

2016-11-24 Thread Thomas Munro
Hi Here is a tiny patch to fix a typo in execParallel.c. -- Thomas Munro http://www.enterprisedb.com typo.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Declarative partitioning - another take

2016-11-24 Thread Robert Haas
On Thu, Nov 24, 2016 at 6:13 AM, Amit Langote wrote: > On 2016/11/23 4:50, Robert Haas wrote: >> On Tue, Nov 22, 2016 at 4:15 AM, Amit Langote >> wrote: The easiest thing to do might be to just enforce that all of the

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Alvaro Herrera
Michael Paquier wrote: > Nit: I did not look at the patch in details, > but I find the size of the latest version sent, 167kB, scary as it > complicates review and increases the likeliness of bugs. Here's the stat. Note that removing the functionality as discussed would remove all of

Re: [HACKERS] macaddr 64 bit (EUI-64) datatype support

2016-11-24 Thread Haribabu Kommi
On Wed, Nov 23, 2016 at 12:53 PM, Tom Lane wrote: > Haribabu Kommi writes: > > On Wed, Nov 23, 2016 at 1:42 AM, Tom Lane wrote: > >> The precedent of int4/int8/float4/float8 is that SQL data types should > >> be named after

Re: [HACKERS] DISTINCT with btree skip scan

2016-11-24 Thread Robert Haas
On Wed, Nov 23, 2016 at 4:19 PM, Thomas Munro wrote: > On Wed, Oct 12, 2016 at 4:19 PM, Thomas Munro > wrote: >> Here it is, now split into two parts: one patch >> to add an amskip operation, and another to consider using it to >>

Re: [HACKERS] IF (NOT) EXISTS in psql-completion

2016-11-24 Thread Kyotaro HORIGUCHI
Hello, Thank you for looking this long-and-bothersome patch. At Wed, 23 Nov 2016 07:12:00 +0100, Pavel Stehule wrote in > Hi > > 2016-11-15 12:26 GMT+01:00 Kyotaro HORIGUCHI

Re: [HACKERS] [bugfix] commit timestamps ERROR on lookup of FrozenTransactionId

2016-11-24 Thread Craig Ringer
On 25 November 2016 at 02:44, Alvaro Herrera wrote: > Craig Ringer wrote: > >> Updated to correct the other expected file, since there's an alternate. > > FWIW I don't know what you did here, but you did not patch the > alternate expected file. Damn. Attached the first

Re: [HACKERS] 9.6 TAP tests and extensions

2016-11-24 Thread Craig Ringer
On 25 November 2016 at 02:47, Alvaro Herrera wrote: > Craig Ringer wrote: >> On 27 October 2016 at 00:42, Robert Haas wrote: >> > On Wed, Oct 26, 2016 at 7:17 AM, Andres Freund wrote: >> >> On 2016-09-23 16:04:32 -0400, Tom

Re: [HACKERS] Declarative partitioning - another take

2016-11-24 Thread Amit Langote
On 2016/11/25 4:36, Alvaro Herrera wrote: > Amit Langote wrote: >> On 2016/11/24 15:10, Ashutosh Bapat wrote: >>> On Thu, Nov 24, 2016 at 11:34 AM, Amit Langote wrote: > You have to specify column constraints using the keywords WITH OPTIONS, like below: create table p1

Re: [HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Craig Ringer
On 25 November 2016 at 07:36, Michael Paquier wrote: > On Thu, Nov 24, 2016 at 11:01 PM, Magnus Hagander wrote: >> On Thu, Nov 24, 2016 at 2:58 PM, Craig Ringer wrote: >> My guess is that PGDLLIMPORT has been added

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Michael Paquier
On Fri, Nov 25, 2016 at 3:31 AM, Pavel Stehule wrote: > 2016-11-24 18:51 GMT+01:00 Tom Lane : >> contrib/xml2 has always relied on libxslt for xpath functionality. >> Can we do that here instead of writing, debugging, and documenting >> a pile of new

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Robert Haas
On Thu, Nov 24, 2016 at 6:20 PM, Pavel Stehule wrote: >> I think that the whole emphasis on whether and to what degree this is >> like Oracle is somewhat misplaced. I would look at it a different >> way. We've talked many times over the years about how PostgreSQL is >>

Re: [HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Michael Paquier
On Thu, Nov 24, 2016 at 11:01 PM, Magnus Hagander wrote: > On Thu, Nov 24, 2016 at 2:58 PM, Craig Ringer wrote: > My guess is that PGDLLIMPORT has been added explicitly when somebody needed > it for something, without any actual thought. I can't say I

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Pavel Stehule
> I think that the whole emphasis on whether and to what degree this is > like Oracle is somewhat misplaced. I would look at it a different > way. We've talked many times over the years about how PostgreSQL is > optimized for aborts. Everybody that I've heard comment on that issue > thinks that

Re: [HACKERS] Broken SSL tests in master

2016-11-24 Thread Andreas Karlsson
On 11/24/2016 10:38 PM, Andreas Karlsson wrote: To me it feels like the proper fix would be to make PQHost() return the value of the host parameter rather than the hostaddr (maybe add a new field in the pg_conn_host struct). But would be a behaviour change which might break someones application.

Re: [HACKERS] Functions Immutable but not parallel safe?

2016-11-24 Thread Robert Haas
On Thu, Nov 24, 2016 at 5:29 AM, David Rowley wrote: > There's 11 functions which are marked immutable, but are marked as > parallel unsafe. > > postgres=# select proname from pg_proc where provolatile = 'i' and > proparallel = 'u'; >proname >

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Robert Haas
On Thu, Nov 24, 2016 at 11:06 AM, Greg Stark wrote: > Fwiw, Oracle does not use the undo log for snapshot fetches. It's used > only for transaction rollback and recovery. > > For snapshot isolation Oracle has yet a *third* copy of the data in a > space called the "rollback

Re: [HACKERS] pg_dump / copy bugs with "big lines" ?

2016-11-24 Thread Alvaro Herrera
I propose to rename allow_long to huge_ok. "Huge" is the terminology used by palloc anyway. I'd keep makeLongStringInfo() and initLongStringInfo() though as interface, because using Huge instead of Long there looks strange. Not wedded to that, though (particularly as it's a bit inconsistent).

Re: [HACKERS] [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan

2016-11-24 Thread Andreas Seltenreich
Hi, just caught another InitPlan below Gather with the recent patches in (master as of 4cc6a3f). Recipe below. regards, andreas set max_parallel_workers_per_gather = 2; set min_parallel_relation_size = 0; set parallel_setup_cost = 0; set parallel_tuple_cost = 0; explain select 1 from

[HACKERS] Broken SSL tests in master

2016-11-24 Thread Andreas Karlsson
Hi, The SSL test suite (src/test/ssl) is broken in the master since commit 9a1d0af4ad2cbd419115b453d811c141b80d872b, which is Robert's refactoring of getting the server hostname for GSS, SSPI, and SSL in libpq. The error we get in the test suite: # Running: psql -X -A -t -c SELECT

Re: [HACKERS] pg_dump / copy bugs with "big lines" ?

2016-11-24 Thread Alvaro Herrera
Daniel Verite wrote: > Here's an updated patch. Compared to the previous version: > > - removed CopyStartSend (per comment #1 in review) > > - renamed flag to allow_long (comment #2) > > - resetStringInfo no longer resets the flag (comment #3). > > - allowLongStringInfo() is removed (comment

Re: [HACKERS] Declarative partitioning - another take

2016-11-24 Thread Alvaro Herrera
Amit Langote wrote: > On 2016/11/24 15:10, Ashutosh Bapat wrote: > > On Thu, Nov 24, 2016 at 11:34 AM, Amit Langote wrote: > >> You have to specify column constraints using the keywords WITH OPTIONS, > >> like below: > >> > >> create table p1 partition of p ( > >> a with options primary key >

Re: [HACKERS] 9.6 TAP tests and extensions

2016-11-24 Thread Alvaro Herrera
Craig Ringer wrote: > On 27 October 2016 at 00:42, Robert Haas wrote: > > On Wed, Oct 26, 2016 at 7:17 AM, Andres Freund wrote: > >> On 2016-09-23 16:04:32 -0400, Tom Lane wrote: > >>> Looking back over the thread, I see that you also proposed

Re: [HACKERS] [bugfix] commit timestamps ERROR on lookup of FrozenTransactionId

2016-11-24 Thread Alvaro Herrera
Craig Ringer wrote: > Updated to correct the other expected file, since there's an alternate. FWIW I don't know what you did here, but you did not patch the alternate expected file. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA,

Re: [HACKERS] [bugfix] commit timestamps ERROR on lookup of FrozenTransactionId

2016-11-24 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > I considered the argument here for a bit and I think Craig is right -- > > FWIW, I agree. We shouldn't require every call site to special-case this, > and we definitely don't want it to require special cases in SQL code. >

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Pavel Stehule
2016-11-24 18:51 GMT+01:00 Tom Lane : > Alvaro Herrera writes: > > Pavel Stehule wrote: > >> 2016-11-24 0:13 GMT+01:00 Alvaro Herrera : > >>> Oh my, I just noticed we have a new xpath preprocessor in this patch > >>> too.

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Tom Lane
Alvaro Herrera writes: > Pavel Stehule wrote: >> 2016-11-24 0:13 GMT+01:00 Alvaro Herrera : >>> Oh my, I just noticed we have a new xpath preprocessor in this patch >>> too. Where did this code come from -- did you write it all from >>>

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Alvaro Herrera
Pavel Stehule wrote: > can me send your last work? Sure, it's in the archives -- https://www.postgresql.org/message-id/20161123233130.oqf7jl6czehy5fiw@alvherre.pgsql -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training &

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Pavel Stehule
2016-11-24 18:29 GMT+01:00 Alvaro Herrera : > Pavel Stehule wrote: > > Hi > > > > 2016-11-24 0:13 GMT+01:00 Alvaro Herrera : > > > > > Oh my, I just noticed we have a new xpath preprocessor in this patch > > > too. Where did this code come from

Re: [HACKERS] patch: function xmltable

2016-11-24 Thread Alvaro Herrera
Pavel Stehule wrote: > Hi > > 2016-11-24 0:13 GMT+01:00 Alvaro Herrera : > > > Oh my, I just noticed we have a new xpath preprocessor in this patch > > too. Where did this code come from -- did you write it all from > > scratch? > > I wrote it from scratch - libxml2

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Robert Haas
On Thu, Nov 24, 2016 at 2:32 AM, Tsunakawa, Takayuki wrote: > IMHO, overall, there should be pros and cons of the current approach and the > new UNDo one (like Oracle?), depending on the workload. Under update-heavy > workload, the UNDO method may be better.

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Thomas Kellerer
> FWIW, while this is basically true, the idea of repurposing UNDO to be > usable for MVCC is definitely an Oracleism. Mohan's ARIES paper says > nothing about MVCC. > For snapshot isolation Oracle has yet a *third* copy of the data in a > space called the "rollback segment(s)". UNDO and

Re: [HACKERS] [bugfix] commit timestamps ERROR on lookup of FrozenTransactionId

2016-11-24 Thread Tom Lane
Alvaro Herrera writes: > I considered the argument here for a bit and I think Craig is right -- FWIW, I agree. We shouldn't require every call site to special-case this, and we definitely don't want it to require special cases in SQL code. (And I'm for back-patching,

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Bruce Momjian
On Thu, Nov 24, 2016 at 04:06:14PM +, Greg Stark wrote: > For snapshot isolation Oracle has yet a *third* copy of the data in a > space called the "rollback segment(s)". When you update a row in a > block you save the whole block in the rollback segment. When you try > to access a block you

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Robert Haas
On Wed, Nov 23, 2016 at 5:18 PM, Thomas Munro wrote: > On Wed, Nov 23, 2016 at 6:01 PM, Peter Geoghegan wrote: >> * Our behavior with many duplicates in secondary indexes is pretty bad >> in general, I suspect. > > From the pie-in-the-sky

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Greg Stark
On 23 November 2016 at 04:28, Peter Geoghegan wrote: > On Tue, Nov 22, 2016 at 7:01 PM, Robert Haas wrote: >> This basic DO-UNDO-REDO protocol has been well-understood for >> decades. > > FWIW, while this is basically true, the idea of repurposing UNDO to

Re: [HACKERS] Creating a DSA area to provide work space for parallel execution

2016-11-24 Thread Dilip Kumar
I have one more question, In V1 we were calling dsa_detach in ExecParallelCleanup and in ParallelQueryMain, but it's removed in v2. Any specific reason ? Does this need to be used differently ? ExecParallelCleanup(ParallelExecutorInfo *pei) { + if (pei->area != NULL) + { +

Re: [HACKERS] Creating a DSA area to provide work space for parallel execution

2016-11-24 Thread Dilip Kumar
On Wed, Nov 23, 2016 at 5:42 PM, Thomas Munro wrote: > ... or we could allow DSA areas to be constructed inside existing > shmem, as in the attached patch which requires dsa_create_in_place, > from the patch at >

Re: [HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Victor Wagner
On Thu, 24 Nov 2016 15:01:33 +0100 Magnus Hagander wrote: > On Thu, Nov 24, 2016 at 2:58 PM, Craig Ringer > wrote: > > > Hi all > > > > Noticed this while reading something unrelated > > > > extern PGDLLIMPORT pid_t PostmasterPid; > > extern bool

Re: [HACKERS] Physical append-only tables

2016-11-24 Thread Bruce Momjian
On Thu, Nov 24, 2016 at 10:13:30AM +0100, Magnus Hagander wrote: > On Thu, Nov 24, 2016 at 2:26 AM, Bruce Momjian wrote: > > On Mon, Nov 14, 2016 at 08:43:12PM +, Greg Stark wrote: > > That said, I don't think the "maintain clustering a bit better using > >

Re: [HACKERS] UNDO and in-place update

2016-11-24 Thread Bruce Momjian
On Wed, Nov 23, 2016 at 11:35:38PM -0800, Peter Geoghegan wrote: > On Wed, Nov 23, 2016 at 11:32 PM, Tsunakawa, Takayuki > wrote: > > IMHO, overall, there should be pros and cons of the current approach and > > the new UNDo one (like Oracle?), depending on the

Re: [HACKERS] [PATCH] Reload SSL certificates on SIGHUP

2016-11-24 Thread Andreas Karlsson
On 11/24/2016 02:49 PM, Andreas Karlsson wrote: Thanks for finding this. I will look at this more once I get home, but the tests do not fail on my computer. I wonder what I do differently. What versions of Perl and OpenSSL do you run and how did you run the tests when the failed? I ran the

Re: [HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Magnus Hagander
On Thu, Nov 24, 2016 at 2:58 PM, Craig Ringer wrote: > Hi all > > Noticed this while reading something unrelated > > extern PGDLLIMPORT pid_t PostmasterPid; > extern bool IsPostmasterEnvironment; > extern PGDLLIMPORT bool IsUnderPostmaster; > extern bool

Re: [HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Magnus Hagander
On Thu, Nov 24, 2016 at 2:58 PM, Craig Ringer wrote: > Hi all > > Noticed this while reading something unrelated > > extern PGDLLIMPORT pid_t PostmasterPid; > extern bool IsPostmasterEnvironment; > extern PGDLLIMPORT bool IsUnderPostmaster; > extern bool

[HACKERS] Random PGDLLIMPORTing

2016-11-24 Thread Craig Ringer
Hi all Noticed this while reading something unrelated extern PGDLLIMPORT pid_t PostmasterPid; extern bool IsPostmasterEnvironment; extern PGDLLIMPORT bool IsUnderPostmaster; extern bool IsBackgroundWorker; extern PGDLLIMPORT bool IsBinaryUpgrade; I don't see any sane reason for some of those to

Re: [HACKERS] [PATCH] Reload SSL certificates on SIGHUP

2016-11-24 Thread Andreas Karlsson
On 11/24/2016 08:46 AM, Michael Paquier wrote: On Sat, Nov 12, 2016 at 3:42 AM, Andreas Karlsson wrote: On 11/11/2016 07:40 PM, Andreas Karlsson wrote: Here is a new version of the patch with the only differences; 1) The SSL tests have been changed to use reload rather

Re: [HACKERS] [bugfix] commit timestamps ERROR on lookup of FrozenTransactionId

2016-11-24 Thread Alvaro Herrera
I considered the argument here for a bit and I think Craig is right -- FrozenXid eventually makes it to a tuple's xmin where it becomes a burden to the caller, making our interface bug-prone -- sure you can special-case it, but you don't until it first happens ... and it may not until you're deep

Re: [HACKERS] postgres 9.3 postgres_fdw ::LOG: could not receive data from client: Connection reset by peer

2016-11-24 Thread Vladimir Svedov
Local server log has the line and remote table log is empty (it is configured for minimum warning and when I produce one it appears in log OK) And I have new details - it happens on some additional environments - not constantly. Some hours it happens every time, then just stops appearing:

Re: [HACKERS] Patch to implement pg_current_logfile() function

2016-11-24 Thread Karl O. Pinc
On Wed, 23 Nov 2016 23:08:18 -0600 "Karl O. Pinc" wrote: > On Wed, 23 Nov 2016 03:21:05 -0600 > "Karl O. Pinc" wrote: > > > On Sat, 19 Nov 2016 12:58:47 +0100 > > Gilles Darold wrote: > > > > > ... attached v14 of the patch. > >

Re: [HACKERS] Push down more full joins in postgres_fdw

2016-11-24 Thread Etsuro Fujita
On 2016/11/22 18:28, Ashutosh Bapat wrote: The comments should explain why is the assertion true. +/* Shouldn't be NIL */ +Assert(tlist != NIL); I noticed that I was wrong; in the Assertion the tlist can be empty. An example for such a case is: SELECT 1 FROM (SELECT c1 FROM

Re: [HACKERS] Patch: Implement failover on libpq connect level.

2016-11-24 Thread Mithun Cy
On Wed, Nov 23, 2016 at 10:19 PM, Catalin Iacob wrote: On Tue, Nov 22, 2016 at 8:38 AM, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: >> If you want to connect to a server where the transaction is read-only, then shouldn't the connection parameter be

Re: [HACKERS] Gather Merge

2016-11-24 Thread Rushabh Lathia
On Wed, Nov 16, 2016 at 3:10 PM, Rushabh Lathia wrote: > > > On Mon, Nov 14, 2016 at 3:51 PM, Thomas Munro < > thomas.mu...@enterprisedb.com> wrote: > >> On Sat, Nov 12, 2016 at 1:56 AM, Rushabh Lathia >> wrote: >> > On Fri, Nov 4, 2016 at

Re: [HACKERS] Declarative partitioning - another take

2016-11-24 Thread Amit Langote
On 2016/11/23 4:50, Robert Haas wrote: > On Tue, Nov 22, 2016 at 4:15 AM, Amit Langote > wrote: >>> The easiest thing to do might be to just enforce that all of the >>> partition key columns have to be not-null when the range-partitioned >>> table is defined, and

Re: [HACKERS] DISTINCT with btree skip scan

2016-11-24 Thread Geoff Winkless
On 23 November 2016 at 21:19, Thomas Munro wrote: > Worth pursuing? Does amskip suck? Does anyone have better ideas, > either for how to do the low level skip or the higher level Index Skip > Scan, or perhaps a completely different way of looking at this? I have

[HACKERS] Functions Immutable but not parallel safe?

2016-11-24 Thread David Rowley
There's 11 functions which are marked immutable, but are marked as parallel unsafe. postgres=# select proname from pg_proc where provolatile = 'i' and proparallel = 'u'; proname - _pg_expandarray _pg_keysequal _pg_truetypid _pg_truetypmod

[HACKERS] PassDownLimitBound for ForeignScan/CustomScan [take-2]

2016-11-24 Thread Jeevan Chalke
On Mon, Nov 21, 2016 at 1:59 PM, Kouhei Kaigai wrote: > Hello, > > The attached patch is a revised version of pass-down LIMIT to FDW/CSP. > > Below is the updates from the last version. > > 'ps_numTuples' of PlanState was declared as uint64, instead of long > to avoid

Re: [HACKERS] Push down more full joins in postgres_fdw

2016-11-24 Thread Etsuro Fujita
On 2016/11/24 18:20, Ashutosh Bapat wrote: I wrote: You missed the point; the foreignrel->reltarget->exprs doesn't contain any PHVs, so the tlist created by build_tlist_to_depase will be guaranteed to be one-to-one with the foreignrel->reltarget->exprs. You wrote: It's guaranteed now, but

Re: [HACKERS] Push down more full joins in postgres_fdw

2016-11-24 Thread Ashutosh Bapat
> > build_tlist_to_depase() calls pull_var_nodes() before creating the tlist, whereas the code that searches does not do that. Code-wise those are not the same things. > > >>> You missed the point; the foreignrel->reltarget->exprs doesn't contain >>> any >>> PHVs, so the tlist

Re: [HACKERS] Physical append-only tables

2016-11-24 Thread Magnus Hagander
On Thu, Nov 24, 2016 at 2:26 AM, Bruce Momjian wrote: > On Mon, Nov 14, 2016 at 08:43:12PM +, Greg Stark wrote: > > That said, I don't think the "maintain clustering a bit better using > > BRIN" is a bad idea. It's just the bit about turning a table > > append-only to deal

Re: [HACKERS] Push down more full joins in postgres_fdw

2016-11-24 Thread Etsuro Fujita
On 2016/11/24 17:39, Ashutosh Bapat wrote: On Thu, Nov 24, 2016 at 1:27 PM, Etsuro Fujita wrote: On 2016/11/24 16:46, Ashutosh Bapat wrote: table will be misleading as subquery can represent a join and corresponding alias would represent the join. Relation is

Re: [HACKERS] Push down more full joins in postgres_fdw

2016-11-24 Thread Ashutosh Bapat
On Thu, Nov 24, 2016 at 1:27 PM, Etsuro Fujita wrote: > On 2016/11/24 16:46, Ashutosh Bapat wrote: Sorry. I think the current version is better than previous one. The term "subselect alias" is confusing in the previous version. In the current

Re: [HACKERS] Push down more full joins in postgres_fdw

2016-11-24 Thread Etsuro Fujita
On 2016/11/24 16:46, Ashutosh Bapat wrote: Sorry. I think the current version is better than previous one. The term "subselect alias" is confusing in the previous version. In the current version, "Get the relation and column alias for a given Var node," we need to add word "identifiers" like