Bugs in TOAST handling, OID assignment and redo recovery

2018-04-10 Thread Pavan Deolasee
Hello, One of our 2ndQuadrant support customers recently reported a sudden rush of TOAST errors post a crash recovery, nearly causing an outage. Most errors read like this: ERROR: unexpected chunk number 0 (expected 1) for toast value While we could bring back the cluster to normal quickly

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Craig Ringer
On 10 April 2018 at 14:10, Michael Paquier wrote: > Well, I think that there is place for improving reporting of failure > in file_utils.c for frontends, or at worst have an exit() for any kind > of critical failures equivalent to a PANIC. Yup. In the mean time, speaking

Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

2018-04-10 Thread Michael Paquier
On Tue, Apr 10, 2018 at 10:08:16AM +0200, Julien Rouhaud wrote: > Compilation of external extensions using PGXS appears to be broken > since this commit: > > make[1]: *** /tmp/pgbuild/lib/postgresql/pgxs/src/makefiles/../../src/backend: > No such file or directory. Stop. > make: *** >

Re: Partitioned tables and covering indexes

2018-04-10 Thread Amit Langote
On 2018/04/10 16:07, Jaime Casanova wrote: > Hi, > > Trying covering indexes on partitioned tables i get this error > """ > postgres=# create index on t1_part (i) include (t); > ERROR: cache lookup failed for opclass 0 > """ > > To reproduce: > > create table t1_part (i int, t text) partition

submake-errcodes

2018-04-10 Thread Devrim Gündüz
Hi, I used to run " cd src/backend make submake-errcodes " in the RPM spec file, but looks like it was removed recently. Is that replaced with something else, or removed completely? Regards, -- Devrim Gündüz EnterpriseDB: https://www.enterprisedb.com PostgreSQL Consultant, Red Hat Certified

Re: Transform for pl/perl

2018-04-10 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >> Tom Lane writes: >>> I think you'd have to convert to text and back. That's kind of icky, >>> but it beats failing. > >> I had a look, and that's what the

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2018-04-10 Thread Masahiko Sawada
On Fri, Mar 30, 2018 at 4:43 PM, Michael Paquier wrote: > On Thu, Mar 01, 2018 at 04:01:28PM -0500, Robert Haas wrote: >> If you have a clever idea how to make this work with as few atomic >> operations as the current patch uses while at the same time reducing >> the

Re: submake-errcodes

2018-04-10 Thread Christoph Berg
Re: Devrim Gündüz 2018-04-10 <1523353963.8169.26.ca...@gunduz.org> > I used to run > > " > cd src/backend > make submake-errcodes > " > > in the RPM spec file, but looks like it was removed recently. Is that replaced > with something else, or removed completely? It is gone:

Re: [HACKERS] path toward faster partition pruning

2018-04-10 Thread David Rowley
On 10 April 2018 at 20:56, Amit Langote wrote: > On 2018/04/10 13:27, Ashutosh Bapat wrote: >> On Mon, Apr 9, 2018 at 8:56 PM, Robert Haas wrote: >>> CREATE OR REPLACE FUNCTION hashint4_noop(int4, int8) RETURNS int8 AS >>> $$SELECT

Re: [HACKERS] Replication status in logical replication

2018-04-10 Thread Masahiko Sawada
On Fri, Mar 30, 2018 at 5:37 AM, Fujii Masao wrote: > On Wed, Jan 17, 2018 at 2:16 AM, Simon Riggs wrote: >> On 16 January 2018 at 06:21, Michael Paquier >> wrote: >>> On Tue, Jan 16, 2018 at 10:40:43AM +0900, Masahiko

Re: Boolean partitions syntax

2018-04-10 Thread Kyotaro HORIGUCHI
Hello. Note: This is not intended to be committed this time but just for information. At Tue, 10 Apr 2018 10:34:27 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180410.103427.244142052.horiguchi.kyot...@lab.ntt.co.jp> > Just adding negation would

Re: Custom PGC_POSTMASTER GUC variables ... feasible?

2018-04-10 Thread Sergei Kornilov
Hello See for example contrib pg_stat_statements extension. Setting pg_stat_statements.max defined as PGC_POSTMASTER regards, Sergei

Re: [HACKERS] path toward faster partition pruning

2018-04-10 Thread Amit Langote
On 2018/04/10 13:27, Ashutosh Bapat wrote: > On Mon, Apr 9, 2018 at 8:56 PM, Robert Haas wrote: >> On Fri, Apr 6, 2018 at 11:41 PM, Tom Lane wrote: >>> David Rowley writes: Sounds like you're saying that if we have

Re: [PATCH] pg_hba.conf : new auth option : clientcert=verify-full

2018-04-10 Thread Julian Markwort
On Fri, 2018-04-06 at 20:31 +0200, Magnus Hagander wrote: > I've been through this one again. Thanks for taking the time! > There is one big omission from it -- it fails to work with the view > pg_hba_file_rules. When fixing that, things started to look kind of > ugly with the "two booleans to

Re: [HACKERS] path toward faster partition pruning

2018-04-10 Thread Ashutosh Bapat
On Tue, Apr 10, 2018 at 5:32 PM, David Rowley wrote: > On 10 April 2018 at 20:56, Amit Langote wrote: >> On 2018/04/10 13:27, Ashutosh Bapat wrote: >>> On Mon, Apr 9, 2018 at 8:56 PM, Robert Haas wrote:

Re: Function to track shmem reinit time

2018-04-10 Thread David Steele
On 3/29/18 9:40 AM, Tomas Vondra wrote: > On 03/28/2018 08:55 PM, David Steele wrote: > >> I'm setting this entry to Waiting on Author, but based on the discussion >> I think it should be Returned with Feedback. >> > > Fine with me. This entry has been marked Returned with Feedback. Regards,

Re: power() function in Windows: "value out of range: underflow"

2018-04-10 Thread Euler Taveira
2018-04-10 5:30 GMT-03:00 Huong Dangminh : > There are some cases that power() function does not work > correctly with 'NaN' arguments in Windows environment. > Something like, > What is your exact OS version? What is your postgres version? I tested with Windows 10

Re: Transform for pl/perl

2018-04-10 Thread Dagfinn Ilmari Mannsåker
ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > Tom Lane writes: > >> ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >>> While playing around some more with the extension, I discoverered a few >>> more issues: >>> ... >>> 4) SV_to_JsonbValue()

Re: [PATCH] pg_hba.conf : new auth option : clientcert=verify-full

2018-04-10 Thread Peter Eisentraut
On 4/10/18 08:10, Julian Markwort wrote: >> Attached is an updated patch with these changes. I'd appreciate it if >> you can run it through your tests to confirm that it didn't break any >> of those usecases. > I've tested a couple of things with this and it seems to work as > expected.

Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

2018-04-10 Thread Tom Lane
Julien Rouhaud writes: > Compilation of external extensions using PGXS appears to be broken > since this commit: Ouch, sorry. > I think the best fix if to define NO_GENERATED_HEADERS in pgxs.mk, > patch attached. Hm. I wonder if we don't also want NO_TEMP_INSTALL, like the

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2018-04-10 Thread Mark Rofail
Hello David, On Tue, Apr 10, 2018 at 3:47 PM, David Steele wrote: > You should produce a new version by then that addresses Alvaro's > concerns and I imagine that will require quite a bit of discussion and > work. I'll get working. I'll produce a patch with two alternate

Re: lazy detoasting

2018-04-10 Thread Tom Lane
Chapman Flack writes: > I'm becoming increasingly glad I asked (or less embarrassed that I hadn't > figured it all out yet). :) > Am I right in thinking that, for my original purpose of detoasting something > later in a transaction, all that matters is that I registered a

Re: Transform for pl/perl

2018-04-10 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >> While playing around some more with the extension, I discoverered a few >> more issues: >> ... >> 4) SV_to_JsonbValue() throws an error for infinite NVs, but not NaNs > > The others

Re: Faster inserts with mostly-monotonically increasing values

2018-04-10 Thread Claudio Freire
On Tue, Apr 10, 2018 at 11:10 AM, Heikki Linnakangas wrote: >> /* XLOG stuff */ >> if (RelationNeedsWAL(rel)) >> { >> ... >> >> if (P_ISLEAF(lpageop)) >> { >>

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2018-04-10 Thread Alvaro Herrera
Mark Rofail wrote: > On Tue, Apr 10, 2018 at 3:59 PM, Alvaro Herrera > wrote: > > > > documentation to it and a few extensive tests to ensure it works well); > > I think the existing regression tests verify that the patch works as > expectations, correct? I meant for

Re: [HACKERS] [PATCH] Incremental sort

2018-04-10 Thread David Steele
On 4/9/18 11:56 AM, Alexander Korotkov wrote: > > Thank you very much for your efforts on reviewing this patch. > I'm looking forward work with you on this feature for PG12. Since there's a new patch I have changed the status to Needs Review and moved the entry to the next CF. Still, it seems

Re: crash with sql language partition support function

2018-04-10 Thread Alvaro Herrera
Ashutosh Bapat wrote: > On Tue, Apr 10, 2018 at 1:44 PM, Amit Langote > wrote: > > > > Attached fixes it. It teaches RelationBuildPartitionKey() to use > > fmgr_info_cxt and pass rd_partkeycxt to it. > > The patch is using partkeycxt and not rd_partkeycxt.

Re: [HACKERS] Replication status in logical replication

2018-04-10 Thread David Steele
On 4/10/18 6:14 AM, Masahiko Sawada wrote: > On Fri, Mar 30, 2018 at 5:37 AM, Fujii Masao wrote: >> On Wed, Jan 17, 2018 at 2:16 AM, Simon Riggs wrote: >>> On 16 January 2018 at 06:21, Michael Paquier >>> wrote: On

Re: Boolean partitions syntax

2018-04-10 Thread David Rowley
On 10 April 2018 at 23:13, Kyotaro HORIGUCHI wrote: > Note: This is not intended to be committed this time but just for > information. > > At Tue, 10 Apr 2018 10:34:27 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI > wrote in >

Re: Partitioned tables and covering indexes

2018-04-10 Thread Alexander Korotkov
On Tue, Apr 10, 2018 at 12:47 PM, Amit Langote < langote_amit...@lab.ntt.co.jp> wrote: > On 2018/04/10 16:07, Jaime Casanova wrote: > > Hi, > > > > Trying covering indexes on partitioned tables i get this error > > """ > > postgres=# create index on t1_part (i) include (t); > > ERROR: cache

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Robert Haas
On Mon, Apr 9, 2018 at 3:13 PM, Andres Freund wrote: > Let's lower the pitchforks a bit here. Obviously a grand rewrite is > absurd, as is some of the proposed ways this is all supposed to > work. But I think the case we're discussing is much closer to a near > irresolvable

Re: 2018-03 CF Cleanup

2018-04-10 Thread Alvaro Herrera
David Steele wrote: > Hackers, > > I have gone through all the remaining non-bug entries in CF 2018-03 and > pushed them or closed them as appropriate. The majority of the patches > were in Needs Review or Ready for Committer status and I did a brief > review of each to be sure the state was

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 1:37 AM, Craig Ringer wrote: > ... but *only if they hit an I/O error* or they're on a FS that > doesn't reserve space and hit ENOSPC. > > It still does 99% of the job. It still flushes all buffers to > persistent storage and maintains write

Re: crash with sql language partition support function

2018-04-10 Thread Tom Lane
Alvaro Herrera writes: > Ashutosh Bapat wrote: >> On Tue, Apr 10, 2018 at 1:44 PM, Amit Langote >> wrote: >>> Attached fixes it. It teaches RelationBuildPartitionKey() to use >>> fmgr_info_cxt and pass rd_partkeycxt to it. >> The patch is

Re: Bugs in TOAST handling, OID assignment and redo recovery

2018-04-10 Thread Heikki Linnakangas
On 10/04/18 13:29, Pavan Deolasee wrote: Hello, One of our 2ndQuadrant support customers recently reported a sudden rush of TOAST errors post a crash recovery, nearly causing an outage. Most errors read like this: ERROR: unexpected chunk number 0 (expected 1) for toast value While we

Re: Transform for pl/perl

2018-04-10 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > While playing around some more with the extension, I discoverered a few > more issues: > ... > 4) SV_to_JsonbValue() throws an error for infinite NVs, but not NaNs The others sound like bugs, but that one's intentional, since

Re: Reopen logfile on SIGHUP

2018-04-10 Thread David Steele
Hi Anastasia, On 3/28/18 1:46 PM, David Steele wrote: > On 2/27/18 8:54 PM, Michael Paquier wrote: >> On Tue, Feb 27, 2018 at 05:52:20PM -0500, Tom Lane wrote: >>> It already does treat SIGUSR1 as a log rotation request. Apparently >>> the point of this patch is that some people don't find that

Re: [HACKERS] Partition-wise aggregation/grouping

2018-04-10 Thread Jeevan Chalke
On Tue, Apr 10, 2018 at 7:30 PM, David Steele wrote: > Hi Jeevan, > > On 4/2/18 10:57 AM, Robert Haas wrote: > > On Thu, Mar 29, 2018 at 9:02 AM, Jeevan Chalke > > wrote: > >> Yep, I see the risk. > > > > Committed 0001 last week and 0002

Re: jsonpath

2018-04-10 Thread David Steele
On 3/27/18 11:13 AM, Nikita Glukhov wrote: > > Attached 14th version of the patches: It appears this entry should be marked Needs Review, so I have done that and moved it to the next CF. Regards, -- -David da...@pgmasters.net

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2018-04-10 Thread Alvaro Herrera
Mark Rofail wrote: > Hello David, > > On Tue, Apr 10, 2018 at 3:47 PM, David Steele wrote: > > > You should produce a new version by then that addresses Alvaro's > > concerns and I imagine that will require quite a bit of discussion and > > work. > > I'll get working. >

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2018-04-10 Thread Mark Rofail
On Tue, Apr 10, 2018 at 3:59 PM, Alvaro Herrera wrote: > > documentation to it and a few extensive tests to ensure it works well); I think the existing regression tests verify that the patch works as expectations, correct? We need more *exhaustive* tests to test

Re: Boolean partitions syntax

2018-04-10 Thread David Rowley
On 3 February 2018 at 12:04, Tom Lane wrote: > Perhaps more useful to discuss: would that truly be the semantics we want, > or should we just evaluate the expression and have done? It's certainly > arguable that "IN (random())" ought to draw an error, not compute some >

Re: lazy detoasting

2018-04-10 Thread Chapman Flack
On 04/10/2018 10:06 AM, Tom Lane wrote: > Chapman Flack writes: >> Am I right in thinking that, for my original purpose of >> detoasting something later in a transaction, all that matters >> is that I registered a snapshot from the time at which I copied >> the toasted

Re: [PATCH][PROPOSAL] Refuse setting toast.* reloptions when TOAST table does not exist

2018-04-10 Thread David Steele
On 4/10/18 9:17 AM, Alvaro Herrera wrote: > Nikolay Shaplov wrote: > >> But I need some confirmation, in order not to write patch in vain again :-) > > Don't worry, rest assured that you will still write *many* patches in > vain, not just this one. Despite the rather dubious pep talk, Álvaro is

Re: Bugs in TOAST handling, OID assignment and redo recovery

2018-04-10 Thread Bernd Helmle
Am Dienstag, den 10.04.2018, 15:59 +0530 schrieb Pavan Deolasee: > One of our 2ndQuadrant support customers recently reported a sudden > rush of > TOAST errors post a crash recovery, nearly causing an outage. Most > errors > read like this: > > ERROR: unexpected chunk number 0 (expected 1) for

Re: [PATCH] Add missing type conversion functions for PL/Python

2018-04-10 Thread David Steele
On 3/26/18 12:07 PM, Nikita Glukhov wrote: > On 26.03.2018 17:19, David Steele wrote: > >> On 2/20/18 10:14 AM, Haozhou Wang wrote: >>> Thank you very much for your review! >>> >>> I attached a new patch with typo fixed. >> I think it's a bit premature to mark this Ready for Committer after a >>

Re: [HACKERS] Partition-wise aggregation/grouping

2018-04-10 Thread David Steele
Hi Jeevan, On 4/2/18 10:57 AM, Robert Haas wrote: > On Thu, Mar 29, 2018 at 9:02 AM, Jeevan Chalke > wrote: >> Yep, I see the risk. > > Committed 0001 last week and 0002 just now. I don't really see 0003 a > a critical need. If somebody demonstrates that this

Re: submake-errcodes

2018-04-10 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=FCnd=FCz?= writes: > I used to run > " > cd src/backend > make submake-errcodes > " > in the RPM spec file, but looks like it was removed recently. Is that replaced > with something else, or removed completely? You could replace it with

Re: Faster inserts with mostly-monotonically increasing values

2018-04-10 Thread Heikki Linnakangas
/* XLOG stuff */ if (RelationNeedsWAL(rel)) { ... if (P_ISLEAF(lpageop)) { xlinfo = XLOG_BTREE_INSERT_LEAF; /*

Re: Custom PGC_POSTMASTER GUC variables ... feasible?

2018-04-10 Thread Tom Lane
Jim Finnerty writes: > What were the possible failure scenarios that throwing a fatal error was > intended to avoid, i.e. what sort of "hooking into" is the comment below > referring to that was regarded as a fate worse than death? The point is that if the extension is

Re: [PATCH][PROPOSAL] Refuse setting toast.* reloptions when TOAST table does not exist

2018-04-10 Thread Nikolay Shaplov
В письме от 10 апреля 2018 08:55:52 пользователь David Steele написал: > On 1/25/18 12:27 PM, Nikolay Shaplov wrote: > > В письме от 25 января 2018 11:29:34 пользователь Tom Lane написал: > >> Alvaro Herrera writes: > >>> Tom Lane wrote: > Well, maybe the right

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

2018-04-10 Thread Nikhil Sontakke
>> Anyways, will now wait for the next commitfest/opportunity to try to >> get this in. > > It looks like this patch should be in the Needs Review state so I have > done that and moved it to the next CF. > Thanks David, Regards, Nikhils -- Nikhil Sontakke

2018-03 CF Cleanup

2018-04-10 Thread David Steele
Hackers, I have gone through all the remaining non-bug entries in CF 2018-03 and pushed them or closed them as appropriate. The majority of the patches were in Needs Review or Ready for Committer status and I did a brief review of each to be sure the state was reasonable. I moved a few Waiting

Re: Boolean partitions syntax

2018-04-10 Thread Tom Lane
David Rowley writes: > I imagined this would have had a check for volatile functions and some > user-friendly error message to say partition bounds must be immutable, > but instead, it does: > postgres=# create table d_p1 partition of d for values in (Random()); >

Re: [PATCH] pg_hba.conf : new auth option : clientcert=verify-full

2018-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2018 at 2:10 PM, Julian Markwort < julian.markw...@uni-muenster.de> wrote: > On Fri, 2018-04-06 at 20:31 +0200, Magnus Hagander wrote: > > I've been through this one again. > > Thanks for taking the time! > > There is one big omission from it -- it fails to work with the view >

pg_dump should use current_database() instead of PQdb()

2018-04-10 Thread Peter Eisentraut
A report from a pgbouncer user revealed that running pg_dump -C/--create does not work through a connection proxy if the virtual database name on the proxy does not match the real database name on the database server. That's because pg_dump looks up the database to be dumped using the information

Re: Boolean partitions syntax

2018-04-10 Thread Tom Lane
David Rowley writes: > On 11 April 2018 at 03:34, Tom Lane wrote: >> Well, that just begs the question: why do these expressions need to >> be immutable? What we really want, I think, is to evaluate them >> and reduce them to constants. After

Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

2018-04-10 Thread Julien Rouhaud
On Tue, Apr 10, 2018 at 6:58 PM, Tom Lane wrote: > > Well, the question that's bothering me is how come "make check" in > an external build doesn't try to execute the temp-install rule before > printing that error message. Experimentation shows that it doesn't, > but it sure

Re: submake-errcodes

2018-04-10 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=FCnd=FCz?= writes: > On Tue, 2018-04-10 at 10:01 -0400, Tom Lane wrote: >> You could replace it with submake-generated-headers, since that's more >> general, but in principle you shouldn't need anything because that >> target is invoked automatically as

Re: Boolean partitions syntax

2018-04-10 Thread Jonathan S. Katz
> On Apr 10, 2018, at 1:22 PM, Tom Lane wrote: > > David Rowley writes: >> On 11 April 2018 at 03:34, Tom Lane wrote: >>> Well, that just begs the question: why do these expressions need to >>> be immutable? What we really

Re: Partitioned tables and covering indexes

2018-04-10 Thread Teodor Sigaev
Does the attached fix look correct?  Haven't checked the fix with ATTACH PARTITION though. Attached patch seems to fix the problem.  However, I would rather get rid of modifying stmt->indexParams.  That seems to be more logical for me.  Also, it would be good to check some covering

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Greg Stark
On 10 April 2018 at 02:59, Craig Ringer wrote: > Nitpick: In most cases the kernel reserves disk space immediately, > before returning from write(). NFS seems to be the main exception > here. I'm kind of puzzled by this. Surely NFS servers store the data in the filesystem

Re: submake-errcodes

2018-04-10 Thread Devrim Gündüz
Hi, On Tue, 2018-04-10 at 10:01 -0400, Tom Lane wrote: > You could replace it with submake-generated-headers, since that's more > general, but in principle you shouldn't need anything because that > target is invoked automatically as of yesterday. What's the larger > context here --- why do you

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread Tom Lane
Alvaro Herrera writes: > Questions: > 1. Do we want to back-patch this to 10? I suppose (without checking) > that EXPLAIN ANALYZE is already reporting bogus numbers for parallel > index-only scans, so I think we should do that. You can't back-patch a change in struct

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread David Rowley
On 11 April 2018 at 03:42, Tom Lane wrote: > Alvaro Herrera writes: >> 2. Do we want to revert Andrew's test stabilization patch? If I >> understand correctly, the problem is the inverse of what was diagnosed: >> "any running transaction at the time

Re: Online enabling of checksums

2018-04-10 Thread Robert Haas
On Fri, Apr 6, 2018 at 8:59 PM, Andres Freund wrote: > This is PROPARALLEL_RESTRICTED. That doesn't strike me right, shouldn't > they be PROPARALLEL_UNSAFE? It might be fine, but I'd not want to rely > on it. Just a fine-grained note on this particular point: It's totally

Re: Optimization of range queries

2018-04-10 Thread Konstantin Knizhnik
On 09.04.2018 20:05, Teodor Sigaev wrote: Hi! 12 years ago I proposed patch to which could "union" OR clauses into one range clause if it's possible. In that time pgsql could not use IS NULL as index clause, so patch doesn't support that

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 12:29 PM, Alvaro Herrera wrote: > In contrast, in an indexonly scan you have a single counter and it > doesn't really matter the distribution of fetches done by workers, so it > seems okay to aggregate them all in a single counter. And it being so

Re: Function to track shmem reinit time

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 9:07 AM, David Steele wrote: > On 3/29/18 9:40 AM, Tomas Vondra wrote: >> On 03/28/2018 08:55 PM, David Steele wrote: >>> I'm setting this entry to Waiting on Author, but based on the discussion >>> I think it should be Returned with Feedback. >> >>

Re: [PATCH][PROPOSAL] Refuse setting toast.* reloptions when TOAST table does not exist

2018-04-10 Thread David Steele
On 1/25/18 12:27 PM, Nikolay Shaplov wrote: > В письме от 25 января 2018 11:29:34 пользователь Tom Lane написал: >> Alvaro Herrera writes: >>> Tom Lane wrote: Well, maybe the right answer is to address that. It's clear to me why that would happen if we store

Re: crash with sql language partition support function

2018-04-10 Thread Ashutosh Bapat
On Tue, Apr 10, 2018 at 1:44 PM, Amit Langote wrote: > > Attached fixes it. It teaches RelationBuildPartitionKey() to use > fmgr_info_cxt and pass rd_partkeycxt to it. The patch is using partkeycxt and not rd_partkeycxt. Probably a typo in the mail. But a wider

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2018-04-10 Thread David Steele
Hi Mark, On 3/26/18 4:50 PM, Mark Rofail wrote: > On 3/7/18 5:43 AM, Alvaro Herrera wrote: > > I searched for the new GIN operator so that I > could brush it up for commit ahead of the rest -- only to find out that > it was eviscerated from the patch between v5 and v5.1. > > The

Re: Bugs in TOAST handling, OID assignment and redo recovery

2018-04-10 Thread Pavan Deolasee
Hi Heikki, On Tue, Apr 10, 2018 at 7:07 PM, Heikki Linnakangas wrote: > >> > It would seem more straightforward to add a snapshot parameter to > GetNewOidWithIndex(), so that the this one caller could pass SnapshotToast, > while others pass SnapshotDirty. With your patch, you

Re: Faster inserts with mostly-monotonically increasing values

2018-04-10 Thread Pavan Deolasee
On Tue, Apr 10, 2018 at 7:49 PM, Claudio Freire wrote: > On Tue, Apr 10, 2018 at 11:10 AM, Heikki Linnakangas > wrote: > > > > > Why is this RelationSetTargetBlock() call inside the "XLOG stuff" block? > > ISTM that we're failing to take advantage of

Re: [HACKERS] [PATCH] Incremental sort

2018-04-10 Thread Alexander Korotkov
On Tue, Apr 10, 2018 at 4:15 PM, David Steele wrote: > On 4/9/18 11:56 AM, Alexander Korotkov wrote: > > > > Thank you very much for your efforts on reviewing this patch. > > I'm looking forward work with you on this feature for PG12. > > Since there's a new patch I have

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread Alvaro Herrera
Changed CC to pgsql-hackers. Tom Lane wrote: > Alvaro Herrera writes: > > Frankly, I don't like this. I would rather have an instrument->ntuples2 > > rather than these "divide this by nloops, sometimes" schizoid counters. > > This is already being misused by ON

Including SQL files in extension scripts

2018-04-10 Thread Jeremy Finzel
In writing extension update scripts, I find it to be really difficult to grok diffs for example in changed view or function definitions when a new extension script has to include the whole definition in a new file. I want to rather use separate files for these objects, then use something like

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 11:14 AM, Alvaro Herrera wrote: > Questions: > 1. Do we want to back-patch this to 10? I suppose (without checking) > that EXPLAIN ANALYZE is already reporting bogus numbers for parallel > index-only scans, so I think we should do that. I haven't

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread Alvaro Herrera
Robert Haas wrote: > On Tue, Apr 10, 2018 at 11:14 AM, Alvaro Herrera > wrote: > > Questions: > > 1. Do we want to back-patch this to 10? I suppose (without checking) > > that EXPLAIN ANALYZE is already reporting bogus numbers for parallel > > index-only scans, so I

Re: Boolean partitions syntax

2018-04-10 Thread David Rowley
On 11 April 2018 at 03:34, Tom Lane wrote: > David Rowley writes: >> I imagined this would have had a check for volatile functions and some >> user-friendly error message to say partition bounds must be immutable, >> but instead, it does: > >>

Re: pg_dump should use current_database() instead of PQdb()

2018-04-10 Thread Tom Lane
Peter Eisentraut writes: > A report from a pgbouncer user revealed that running pg_dump -C/--create > does not work through a connection proxy if the virtual database name on > the proxy does not match the real database name on the database server. > That's

Re: [sqlsmith] Failed assertion in create_gather_path

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 2:59 AM, Jeevan Chalke wrote: > I actually wanted to have rel->consider_parallel in the condition (yes, for > additional safety) as we are adding a partial path into rel. But then > observed that it is same as that of

Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

2018-04-10 Thread Tom Lane
Julien Rouhaud writes: > On Tue, Apr 10, 2018 at 6:58 PM, Tom Lane wrote: >> none of the three if-guards in the temp-install rule itself should >> prevent this, so what is preventing it? I don't see it. > I just checked, and for the record the second

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Anthony Iliopoulos
Hi Robert, On Tue, Apr 10, 2018 at 11:15:46AM -0400, Robert Haas wrote: > On Mon, Apr 9, 2018 at 3:13 PM, Andres Freund wrote: > > Let's lower the pitchforks a bit here. Obviously a grand rewrite is > > absurd, as is some of the proposed ways this is all supposed to > >

Re: pgsql: Support partition pruning at execution time

2018-04-10 Thread David Rowley
On 11 April 2018 at 03:14, Alvaro Herrera wrote: > 2. Do we want to revert Andrew's test stabilization patch? If I > understand correctly, the problem is the inverse of what was diagnosed: > "any running transaction at the time of the test could prevent pages > from

Re: WIP: Covering + unique indexes.

2018-04-10 Thread Teodor Sigaev
* There is no pfree() within _bt_buildadd() for truncated tuples, even though that's a context where it's clearly not okay. Agree * It might be a good idea to also pfree() the truncated tuple for most other _bt_buildadd() callers. Even though it's arguably okay in other cases, it seems worth

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 5:40 AM, Masahiko Sawada wrote: > The probability of performance degradation can be reduced by > increasing N_RELEXTLOCK_ENTS. But as Robert mentioned, while keeping > fast and simple implementation like acquiring lock by a few atomic > operation

Re: [sqlsmith] Segfault in expand_tuple

2018-04-10 Thread Andrew Dunstan
On 04/07/2018 03:28 PM, Andreas Seltenreich wrote: > Hi, > > the following query triggers a segfault for me when run against the > regression database. Testing was done with master at 039eb6e92f. > Backtrace below. > [large query] > Core was generated by `postgres: smith regression [local]

Re: 2018-03 CF Cleanup

2018-04-10 Thread Tom Lane
David Steele writes: > OK, I did it that way and closed the CF. Yay! And many thanks for your hard work on this. regards, tom lane

Re: Reopen logfile on SIGHUP

2018-04-10 Thread Joshua D. Drake
On 04/10/2018 12:17 PM, Tom Lane wrote: Robert Haas writes: On Tue, Feb 27, 2018 at 6:12 PM, Tom Lane wrote: IOW, I think a fair response to this is "if you're using logrotate with Postgres, you're doing it wrong". Well, the original post says

Re: Reopen logfile on SIGHUP

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 3:17 PM, Tom Lane wrote: > We, as in the core project, are not shipping it. +1 for what JD said on that subject. > I'm also unclear > on why you want to exclude "fix the RPM packaging" as a reasonable > solution. Mostly because the complaint was

Re: Reopen logfile on SIGHUP

2018-04-10 Thread Tom Lane
Robert Haas writes: > On Tue, Feb 27, 2018 at 6:12 PM, Tom Lane wrote: >> IOW, I think a fair response to this is "if you're using logrotate with >> Postgres, you're doing it wrong". > Well, the original post says that this is how the PGDG RPMs are

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Joshua D. Drake
-hackers, I reached out to the Linux ext4 devs, here is ty...@mit.edu response: """ Hi Joshua, This isn't actually an ext4 issue, but a long-standing VFS/MM issue. There are going to be multiple opinions about what the right thing to do. I'll try to give as unbiased a description as

Re: Reopen logfile on SIGHUP

2018-04-10 Thread Robert Haas
On Tue, Feb 27, 2018 at 6:12 PM, Tom Lane wrote: > IOW, I think a fair response to this is "if you're using logrotate with > Postgres, you're doing it wrong". Well, the original post says that this is how the PGDG RPMs are doing it on Debian/Ubuntu. I wonder if that's due to

Re: 2018-03 CF Cleanup

2018-04-10 Thread David Steele
On 4/10/18 11:24 AM, Alvaro Herrera wrote: > David Steele wrote: > >> For the moment I have left all bugs in the 2018-03 CF. I can can add >> them to the "Older Bugs" section of the PG 11 Open Items but I'm not >> convinced that is the best way to track them. If they are added to >> "Older

Re: submake-errcodes

2018-04-10 Thread Tom Lane
I wrote: > Hm ... you're cd'ing into src/pl/plpython and issuing "make all"? > That works for me. > ... or, wait ... with -j it doesn't. That's strange, will look. So after a bit of digging, it seems that the locution all: submake-generated-headers doesn't result in ensuring that

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-10 Thread Joshua D. Drake
-hackers, The thread is picking up over on the ext4 list. They don't update their archives as often as we do, so I can't link to the discussion. What would be the preferred method of sharing the info? Thanks, JD -- Command Prompt, Inc. || http://the.postgres.company/ || @cmdpromptinc ***

Re: lazy detoasting

2018-04-10 Thread Robert Haas
On Tue, Apr 10, 2018 at 11:26 AM, Chapman Flack wrote: > Out of the six GetFooSnapshot()s, would I want to squirrel away > Active? Oldest? Transaction? I suspect you want, or maybe need, to use the same snapshot as the scan that retrieved the tuple containing the toasted

Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

2018-04-10 Thread Julien Rouhaud
On Tue, Apr 10, 2018 at 3:46 PM, Tom Lane wrote: > > Julien Rouhaud writes: >> I think the best fix if to define NO_GENERATED_HEADERS in pgxs.mk, >> patch attached. > > Hm. I wonder if we don't also want NO_TEMP_INSTALL, like the doc/src/sgml > makefile.

Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

2018-04-10 Thread Tom Lane
Julien Rouhaud writes: > On Tue, Apr 10, 2018 at 3:46 PM, Tom Lane wrote: >> Hm. I wonder if we don't also want NO_TEMP_INSTALL, like the doc/src/sgml >> makefile. I don't know whether "make check" could be useful in a PGXS >> build, but certainly that

  1   2   >