Re: Calculate total_table_pages after set_base_rel_sizes()

2018-10-05 Thread Edmund Horner
David Rowley said: > I believe that we should be delaying the PlannerInfo's > total_table_pages calculation until after constraint exclusion and > partition pruning have taken place. Doing this calculation before we > determine which relations we don't need to scan can lead to > incorrectly

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> Thanks. Just scanning through the code quickly, I note that it Tom> assumes IEEE float format, which is probably okay but I suppose we Tom> might want a configure switch to disable it (and revert to Tom> platform sprintf). Yeah, but even s390 these days

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Tom Lane
Andrew Gierth writes: > Tom> Oh yeah? Where's the code for this? > Upstream code is at https://github.com/ulfjack/ryu > ... > I attach the patch I've used for testing, which has these changes from > upstream Ryu: Thanks. Just scanning through the code quickly, I note that it assumes IEEE

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> Ryu is so blazing fast that with it, COPY of a table with 2million >> rows of 12 random float8 columns (plus id) becomes FASTER in text >> mode than in binary mode (rather than ~5x slower): Tom> Oh yeah? Where's the code for this? Upstream code is at

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Tom Lane
Andrew Gierth writes: > So here's a thing: I finally got to doing my performance tests for using > the Ryu float output code in float[48]out. > Ryu is so blazing fast that with it, COPY of a table with 2million rows > of 12 random float8 columns (plus id) becomes FASTER in text mode than > in

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Andrew Gierth
> "Andres" == Andres Freund writes: Andres> I'm not convinced. Because of some hypothetical platform that Andres> may introduce strfromd() in a broken/slower manner, but where Andres> sprintf() is correct, we should not do the minimal work to Andres> alleviate an actual performance

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Tom Lane
I stepped back a bit from the raw performance question and thought about what we actually want functionally in snprintf's float handling. There are a couple of points worth making: * The fact that float[48]out explicitly handle NaN and Inf cases is a leftover from when they had to cope with

Re: Early WIP/PoC for inlining CTEs

2018-10-05 Thread Andrew Gierth
> "David" == David Fetter writes: >> Consider the difference between (in the absence of CTE inlining): >> >> -- inline subquery with no optimization barrier (qual may be pushed down) >> select * from (select x from y) s where x=1; David> ...and doesn't need to materialize all of y,

Re: Assertion failure with ALTER TABLE ATTACH PARTITION with log_min_messages >= DEBUG1

2018-10-05 Thread Alvaro Herrera
On 2018-Oct-06, Michael Paquier wrote: > On Fri, Oct 05, 2018 at 12:41:29PM -0300, Alvaro Herrera wrote: > > On 2018-Oct-05, Michael Paquier wrote: > >> Looking at the stack trace there is this log in > >> validateForeignKeyConstraint: > >> ereport(DEBUG1, > >> (errmsg("validating foreign

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Alvaro Herrera
On 2018-Oct-06, Michael Paquier wrote: > On Fri, Oct 05, 2018 at 04:04:02PM -0400, Tom Lane wrote: > > Alvaro Herrera writes: > >> On 2018-Oct-04, Tom Lane wrote: > >>> Not sure about that. Alvaro seems to think there's a generic problem > >>> in event trigger processing, which if true, was

Re: Relax transactional restrictions on ALTER ENUM ... ADD TYPE (redux)

2018-10-05 Thread Thomas Munro
On Sat, Oct 6, 2018 at 2:31 AM Andrew Dunstan wrote: > >> On Wed, Oct 3, 2018 at 2:24 PM Thomas Munro > >> wrote: > >>> Over the thread for bug #14825 I posted some draft code to show one > >>> way to save/restore the enum blacklist for parallel workers. Here's a > >>> better version, and a new

Re: Assertion failure with ALTER TABLE ATTACH PARTITION with log_min_messages >= DEBUG1

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 12:41:29PM -0300, Alvaro Herrera wrote: > On 2018-Oct-05, Michael Paquier wrote: >> Looking at the stack trace there is this log in >> validateForeignKeyConstraint: >> ereport(DEBUG1, >> (errmsg("validating foreign key constraint \"%s\"", conname))); >> >> However

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 04:04:02PM -0400, Tom Lane wrote: > Alvaro Herrera writes: >> On 2018-Oct-04, Tom Lane wrote: >>> Not sure about that. Alvaro seems to think there's a generic problem >>> in event trigger processing, which if true, was likely there pre-v11. > >> After sleeping on this, I

Re: Early WIP/PoC for inlining CTEs

2018-10-05 Thread David Fetter
On Fri, Oct 05, 2018 at 01:40:05AM +0100, Andrew Gierth wrote: > > "Andreas" == Andreas Karlsson writes: > > > On 10/03/2018 05:57 PM, David Fetter wrote: > >> Is there any meaningful distinction between "inlining," by which I > >> mean converting to a subquery, and predicate pushdown,

Re: now() vs transaction_timestamp()

2018-10-05 Thread Tom Lane
I wrote: > So transaction_timestamp() is definitely buggy, but we're not out of the > woods yet: SQLValueFunction is treated as parallel-safe, but it also has > some instances that are equivalent to transaction_timestamp and so do not > work correctly. Oh, and I notice that timestamp_in and

Re: now() vs transaction_timestamp()

2018-10-05 Thread Tom Lane
I wrote: > Konstantin Knizhnik writes: >> Postgres documentation says that |"now()| is a traditional PostgreSQL >> equivalent to |transaction_timestamp()|". >> Also both use the same implementation. > Right. >> But them have different parallel safety property: > That seems like a bug/thinko.

Re: Postgres 11 release notes

2018-10-05 Thread Jonathan S. Katz
On 10/5/18 5:22 PM, Bruce Momjian wrote: > On Fri, Oct 5, 2018 at 03:28:41PM -0400, Jonathan Katz wrote: >> On 9/27/18 9:21 PM, Amit Langote wrote: >>> Yeah, "any other partition" is what the existing description uses too, so: >>> >>> Having a "default" partition for storing data that does not

Re: Postgres 11 release notes

2018-10-05 Thread Bruce Momjian
On Fri, Oct 5, 2018 at 03:28:41PM -0400, Jonathan Katz wrote: > On 9/27/18 9:21 PM, Amit Langote wrote: > > Yeah, "any other partition" is what the existing description uses too, so: > > > > Having a "default" partition for storing data that does not match any > > other partition > > Sorry for

Re: WIP: Avoid creation of the free space map for small tables

2018-10-05 Thread Thomas Munro
On Sat, Oct 6, 2018 at 7:47 AM John Naylor wrote: > A while back, Robert Haas noticed that the space taken up by very > small tables is dominated by the FSM [1]. Tom suggested that we could > prevent creation of the FSM until the heap has reached a certain > threshold size [2]. Attached is a WIP

Re: Create roles trigger

2018-10-05 Thread Nasby, Jim
Please do not post to multiple lists. Moving -hackers to BCC. > On Sep 27, 2018, at 4:07 AM, Александр Аникин wrote: > > Hey, folks! > > I've got a question about events on roles creation. > > I need to execute some custom logic on role creation. > > All information about roles located in

Re: Odd 9.4, 9.3 buildfarm failure on s390x

2018-10-05 Thread Tom Lane
I wrote: > I'm inclined to just go ahead and apply/backpatch this. It's certainly > possible that more bugs remain to be found, but I have no good ideas > about how to search for them, and in any case that wouldn't invalidate > the patch as it stands. And done. If anyone can think of additional

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Oct-04, Tom Lane wrote: >> Not sure about that. Alvaro seems to think there's a generic problem >> in event trigger processing, which if true, was likely there pre-v11. > After sleeping on this, I think that a better answer is to fix the crash > per Michael's

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Alvaro Herrera
On 2018-Oct-04, Tom Lane wrote: > "Jonathan S. Katz" writes: > > On 10/4/18 8:34 PM, Michael Paquier wrote: > >> I am suggesting to fix the issue after RC1 is released, but before GA. > > > That approach would mean we would require an RC2, which would further > > delay the GA. > > Not sure

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Jonathan S. Katz
On 10/5/18 3:35 PM, Andres Freund wrote: > Hi, > > On 2018-10-05 15:31:37 -0400, Jonathan S. Katz wrote: >> On 10/4/18 11:37 PM, Tom Lane wrote: >>> "Jonathan S. Katz" writes: On 10/4/18 8:34 PM, Michael Paquier wrote: > I am suggesting to fix the issue after RC1 is released, but before

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Andres Freund
Hi, On 2018-10-05 15:31:37 -0400, Jonathan S. Katz wrote: > On 10/4/18 11:37 PM, Tom Lane wrote: > > "Jonathan S. Katz" writes: > >> On 10/4/18 8:34 PM, Michael Paquier wrote: > >>> I am suggesting to fix the issue after RC1 is released, but before GA. > > > >> That approach would mean we would

Re: Segfault when creating partition with a primary key and sql_drop trigger exists

2018-10-05 Thread Jonathan S. Katz
On 10/4/18 11:37 PM, Tom Lane wrote: > "Jonathan S. Katz" writes: >> On 10/4/18 8:34 PM, Michael Paquier wrote: >>> I am suggesting to fix the issue after RC1 is released, but before GA. > >> That approach would mean we would require an RC2, which would further >> delay the GA. > > Not sure

Re: Postgres 11 release notes

2018-10-05 Thread Jonathan S. Katz
On 9/27/18 9:21 PM, Amit Langote wrote: > On 2018/09/27 23:24, Alvaro Herrera wrote: >> On 2018-Sep-27, Amit Langote wrote: >> >>> Sorry I couldn't reply sooner, but the following of your proposed text >>> needs to be updated a bit: >>> >>> + >>> + >>> + Having a "default"

WIP: Avoid creation of the free space map for small tables

2018-10-05 Thread John Naylor
Hi all, A while back, Robert Haas noticed that the space taken up by very small tables is dominated by the FSM [1]. Tom suggested that we could prevent creation of the FSM until the heap has reached a certain threshold size [2]. Attached is a WIP patch to implement that. I've also attached a SQL

Re: Skylake-S warning

2018-10-05 Thread Andres Freund
Hi, On 2018-10-03 17:28:59 -0700, Daniel Wood wrote: > FYI, be careful with padding PGXACT's to a full cache line. I'm not actually thinking of doing that, but just to round it up so we don't have PGXACTs spanning cachelines. It's currently 12bytes, so we end up with one spanning 60-72, then

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Tom Lane
Andres Freund writes: > On 2018-10-05 11:54:59 -0400, Tom Lane wrote: >> I really think that what we ought to do is apply the float[48]out hack >> I showed in <30551.1538517...@sss.pgh.pa.us> and call it good, at least >> till such time as somebody wants to propose a full-on reimplementation of

Re: SCRAM with channel binding downgrade attack

2018-10-05 Thread Bruce Momjian
On Fri, Oct 5, 2018 at 04:53:34PM +0200, Peter Eisentraut wrote: > On 23/05/2018 08:46, Heikki Linnakangas wrote: > > "tls-unique" and "tls-server-end-point" are overly technical to users. > > They don't care which one is used, there's no difference in security. > > A question was raised about

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Andres Freund
Hi, On 2018-10-05 11:54:59 -0400, Tom Lane wrote: > Andres Freund writes: > > [ let's use strfromd ] > > So I'm having second thoughts about this, based on the fact that > strfromd() in't strictly a glibc-ism but is defined in an ISO/IEC > standard. That means that we can expect to see it

Re: Performance improvements for src/port/snprintf.c

2018-10-05 Thread Tom Lane
Andres Freund writes: > [ let's use strfromd ] So I'm having second thoughts about this, based on the fact that strfromd() in't strictly a glibc-ism but is defined in an ISO/IEC standard. That means that we can expect to see it start showing up on other platforms (though a quick search did not

Re: NOTIFY and pg_notify performance when deduplicating notifications

2018-10-05 Thread Catalin Iacob
On Tue, Oct 2, 2018 at 7:20 PM wrote: > I have a feature built around LISTEN / NOTIFY that works perfectly well, > except for the enormous performance impact to transactions that emit large > numbers of notifications. Indeed, I have the same and am very interested in this. > I hope this patch

Re: Assertion failure with ALTER TABLE ATTACH PARTITION with log_min_messages >= DEBUG1

2018-10-05 Thread Alvaro Herrera
On 2018-Oct-05, Michael Paquier wrote: > Looking at the stack trace there is this log in > validateForeignKeyConstraint: > ereport(DEBUG1, > (errmsg("validating foreign key constraint \"%s\"", conname))); > > However conname is set to NULL in this code path. Ouch. Thanks for catching

Re: Jsonb transform for pl/python

2018-10-05 Thread Peter Eisentraut
On 27/09/2018 16:58, Nikita Glukhov wrote: > Working on the new lazy transform for jsonb I found another memory leak in > PLyObject_ToJsonbValue(): palloc() for output boolean JsonbValue is > unnecessary, > 'out' variable is already initialized. > > Fix is attached. Committed, thanks. --

Re: Odd 9.4, 9.3 buildfarm failure on s390x

2018-10-05 Thread Tom Lane
I wrote: > Here's a draft patch against HEAD for this. > I looked for problem spots by (a) testing with the STRESS_SORT_INT_MIN > option I added in nbtcompare.c, (b) grepping for "x = -x" type code, > and (c) grepping for "return -x" type code. (b) and (c) found several > places that (a) didn't,

Re: TupleTableSlot abstraction

2018-10-05 Thread Amit Khandekar
On Thu, 4 Oct 2018 at 22:59, Amit Khandekar wrote: > > I have only done the below two changes yet. After doing that and > rebasing with latest master, in the regression I got crashes, and I > suspect the reason being that I have used Virtual tuple slot for the > destination slot of

Re: SCRAM with channel binding downgrade attack

2018-10-05 Thread Peter Eisentraut
On 23/05/2018 08:46, Heikki Linnakangas wrote: > "tls-unique" and "tls-server-end-point" are overly technical to users. > They don't care which one is used, there's no difference in security. A question was raised about this in a recent user group meeting. When someone steals the server

Re: Libpq support to connect to standby server as priority

2018-10-05 Thread Laurenz Albe
Haribabu Kommi wrote: > On Thu, Jul 19, 2018 at 10:59 PM Haribabu Kommi > wrote: > > On Wed, Jul 18, 2018 at 10:53 PM Robert Haas wrote: > > > On Wed, Jul 4, 2018 at 9:14 AM, Laurenz Albe > > > wrote: > > > > What about keeping the first successful connection open and storing > > > > it in

Re: now() vs transaction_timestamp()

2018-10-05 Thread Tom Lane
Konstantin Knizhnik writes: > Postgres documentation says that |"now()| is a traditional PostgreSQL > equivalent to |transaction_timestamp()|". > Also both use the same implementation. Right. > But them have different parallel safety property: That seems like a bug/thinko. I am not sure

Re: Relax transactional restrictions on ALTER ENUM ... ADD TYPE (redux)

2018-10-05 Thread Andrew Dunstan
On 10/03/2018 12:02 AM, Thomas Munro wrote: On Wed, Oct 3, 2018 at 4:42 PM Thomas Munro wrote: On Wed, Oct 3, 2018 at 2:24 PM Thomas Munro wrote: Over the thread for bug #14825 I posted some draft code to show one way to save/restore the enum blacklist for parallel workers. Here's a

now() vs transaction_timestamp()

2018-10-05 Thread Konstantin Knizhnik
Postgres documentation says that |"now()| is a traditional PostgreSQL equivalent to |transaction_timestamp()|". Also both use the same implementation. But them have different parallel safety property: postgres=# \df+ now List of functions    Schema   | Name | Result data type | Argument

Re: automatic restore point

2018-10-05 Thread Peter Eisentraut
On 02/10/2018 00:06, Alvaro Herrera wrote: > Re-reading the implementation in standard_ProcessUtility, I wonder what > is PROCESS_UTILITY_QUERY_NONATOMIC -- there seems to be a maze through > SPI that determines whether this flag is set or not, which could affect > whether the event trigger is

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-10-05 Thread David Rowley
On 17 September 2018 at 21:15, David Rowley wrote: > v9 patch attached. Fixes conflict with 6b78231d. v10 patch attached. Fixes conflict with cc2905e9. I'm not so sure we need to zero the partition_tuple_slots[] array at all since we always set a value there is there's a corresponding map

Re: partition tree inspection functions

2018-10-05 Thread Jesper Pedersen
On 10/5/18 2:52 AM, Michael Paquier wrote: On Fri, Oct 05, 2018 at 03:31:49PM +0900, Amit Langote wrote: Thanks for making those changes yourself and posting the new version. Can you check the attached diff file for some updates to the documentation part of the patch. Other parts look fine.

Re: [HACKERS] Support for Secure Transport SSL library on macOS as OpenSSL alternative

2018-10-05 Thread Peter Eisentraut
On 02/10/2018 15:40, Tom Lane wrote: > Peter Eisentraut writes: >> On 26/09/2018 23:19, Daniel Gustafsson wrote: >>> It’s not clear to me just how common it is to use GCC via homebrew on macOS. > >> I use that all the time. > > Hm, so did 5e2217131 break anything for you? Does that version of

Re: Procedure calls are not tracked in pg_stat_user_functions / track_functions

2018-10-05 Thread Peter Eisentraut
On 04/10/2018 22:07, Andres Freund wrote: > On 2018-10-04 12:15:28 -0700, Lukas Fittl wrote: >> Was this intentional, or an oversight? >> >> If welcome, I would be happy to work on a patch. Whilst slightly confusing >> in terms of naming, we could just track this together with functions, since >>

Re: TAP tests for pg_verify_checksums

2018-10-05 Thread Michael Banck
Hi, On Fri, Oct 05, 2018 at 10:26:45AM +0900, Michael Paquier wrote: > The topic of $subject has been discussed a bit times, resulting in a > couple of patches on the way: > https://www.postgresql.org/message-id/20180830200258.gg15...@paquier.xyz >

Re: transction_timestamp() inside of procedures

2018-10-05 Thread Peter Eisentraut
On 02/10/2018 16:58, Andres Freund wrote: > It's a bit weird to make this decision based on these two timestamps > differing. For one, it only indirectly seems to be guaranteed that > xactStartTimestamp is even set to anything here (to 0 by virtue of being > a global var). Maybe but it seems to

Re: Function for listing archive_status directory

2018-10-05 Thread 'Christoph Moench-Tegeder'
Hi, ## Iwata, Aya (iwata@jp.fujitsu.com): > I think it is convenient to be able to check the archive_status > directory contents information. > > I reviewed patch. It applies and passes regression test. Great, thanks! > All similar function are named pg_ls_***dir. It is clear these

Re: Problems with plan estimates in postgres_fdw

2018-10-05 Thread Etsuro Fujita
(2018/08/02 23:41), Tom Lane wrote: Andrew Gierth writes: [ postgres_fdw is not smart about exploiting fast-start plans ] Yeah, that's basically not accounted for at all in the current design. One possibility: would it be worth adding an option to EXPLAIN that makes it assume

Re: Alter index rename concurrently to

2018-10-05 Thread Peter Eisentraut
On 03/10/2018 13:51, Andrey Klychkov wrote: > 1. Patch was applied without any errors except a part related to > documentation: > error: patch failed: doc/src/sgml/ref/alter_index.sgml:50 > error: doc/src/sgml/ref/alter_index.sgml: patch does not apply Attached is an updated patch. > 2. The code

GCI Mentor

2018-10-05 Thread Anushi Maheshwari
Hi, I am Anushi Maheshwari, Software Engineer in Samsung R, looking forward to be a GCI mentor of Postgresql organisation. I am proficient in C++, Nodejs, Git/Hg, Python, Bash, SQL/PostgreSQL and have working knowledge of JAVA and Android. In the context of Open Source I am active contributor in

Re: Problem while updating a foreign table pointing to a partitioned table on foreign server

2018-10-05 Thread Etsuro Fujita
(2018/10/02 21:16), Etsuro Fujita wrote: Attached is an updated version of the patch. Changes: That patch conflicts the recent executor changes, so I'm attaching a rebased patch, in which I also added a fast path to add_params_to_result_rel and did some comment editing for consistency.

Re: pg_upgrade failed with ERROR: null relpartbound for relation 18159 error.

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 04:55:51PM +0900, Amit Langote wrote: > On 2018/10/05 16:05, Michael Paquier wrote: >> Hmm. Indeed, v10 does not complain but HEAD does. (I ran the attached >> SQL file, which is the complete test case both of you have compiled). > > Did you forget to attach some file?

Re: out-of-order XID insertion in KnownAssignedXids

2018-10-05 Thread Konstantin Knizhnik
On 05.10.2018 11:04, Michael Paquier wrote: On Fri, Oct 05, 2018 at 10:06:45AM +0300, Konstantin Knizhnik wrote: As you can notice, XID 2004495308 is encountered twice which cause error in KnownAssignedXidsAdd:     if (head > tail &&        

RE: [Proposal] Add accumulated statistics for wait event

2018-10-05 Thread Yotsunaga, Naoki
On Thu, Oct 4, 2018 at 0:54 AM, Phil Florent wrote: Phil, Michael, I appreciate your polite comments. I understand as follows. We can find it if we shorten the sampling interval, but a lot of information comes out. # The balance is important. Also, it is not good unless we have enough samples.

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-10-05 Thread Daniel Gustafsson
> On 4 Oct 2018, at 13:00, Michael Paquier wrote: > > On Thu, Oct 04, 2018 at 10:06:06AM +0200, Daniel Gustafsson wrote: >> Yes, you are correct, the signalfuncs.h includes in 0001 are a rebase error >> from when I renamed the file. They are not present in the v15 patch but got >> introduced in

Re: out-of-order XID insertion in KnownAssignedXids

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 10:06:45AM +0300, Konstantin Knizhnik wrote: > As you can notice, XID 2004495308 is encountered twice which cause error in > KnownAssignedXidsAdd: > >     if (head > tail && >         TransactionIdFollowsOrEquals(KnownAssignedXids[head - 1], from_xid)) >     { >        

Re: pg_upgrade failed with ERROR: null relpartbound for relation 18159 error.

2018-10-05 Thread Amit Langote
On 2018/10/05 16:05, Michael Paquier wrote: >> As of commit 2fbdf1b38bc [1], which has been applied in 11 and HEAD >> branches, RelationBuildPartitionDesc emits an error if we don't find >> relpartbound set for a child found by scanning pg_inherits, instead of >> skipping such children. While

Re: Function to promote standby servers

2018-10-05 Thread Masahiko Sawada
On Thu, Oct 4, 2018 at 8:26 PM Laurenz Albe wrote: > > Michael Paquier wrote: > > > In that vein, I propose a function pg_promote() to promote > > > physical standby servers. +1 > > > > No fundamental issues from me regarding the concept of being able to > > trigger a promotion remotely, so +1.

out-of-order XID insertion in KnownAssignedXids

2018-10-05 Thread Konstantin Knizhnik
Hi hackers, Looks like there is a bug with logging running transactions XIDs and prepared transactions. One of our customers get error "FATAL: out-of-order XID insertion in KnownAssignedXids" trying to apply backup. WAL contains the following record: rmgr: Standby len (rec/tot): 98/  

Re: pg_upgrade failed with ERROR: null relpartbound for relation 18159 error.

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 03:06:52PM +0900, Amit Langote wrote: > To reproduce, the following works too (after creating the objects as > described above): > > alter table partkey_t detach partition partkey_t_1; > alter table partkey_t attach partition partkey_t_1 for values from (0) to > (1000); >

Re: Replace PG_AUTOCONF_FILENAME with parameter

2018-10-05 Thread Andrew Gierth
> "Jonathan" == Jonathan Jacobson writes: Jonathan> As opposed to config_file, hba_file, etc. the name and Jonathan> location of the autoconfig file is fixed to Jonathan> $PGDATA/postgresql.auto.conf (guc.h) The reason it's in a fixed location is that the server needs to be able to

Re: partition tree inspection functions

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 03:31:49PM +0900, Amit Langote wrote: > Thanks for making those changes yourself and posting the new version. > > Can you check the attached diff file for some updates to the documentation > part of the patch. Other parts look fine. OK, I merged that into my local

Re: Replace PG_AUTOCONF_FILENAME with parameter

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 09:39:03AM +0300, Jonathan Jacobson wrote: > As opposed to config_file, hba_file, etc. the name and location of the > autoconfig file is fixed to $PGDATA/postgresql.auto.conf (guc.h) > > The static name also appears in some other locations, such as > pg_basebackup,

Replace PG_AUTOCONF_FILENAME with parameter

2018-10-05 Thread Jonathan Jacobson
As opposed to config_file, hba_file, etc. the name and location of the autoconfig file is fixed to $PGDATA/postgresql.auto.conf (guc.h) The static name also appears in some other locations, such as pg_basebackup, pg_rewind & initdb.c. New feature suggestion: Allow to set the file's location, as

Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru

2018-10-05 Thread Michael Paquier
On Fri, Oct 05, 2018 at 12:16:03PM +0900, Michael Paquier wrote: > So, I have come back to this stuff, and finished with the attached > instead, so as the assertion is in a single place. I find that > clearer. The comments have also been improved. Thoughts? And so... I have been looking at

Re: partition tree inspection functions

2018-10-05 Thread Amit Langote
On 2018/10/05 14:56, Michael Paquier wrote: > On Thu, Oct 04, 2018 at 05:18:07PM +0900, Michael Paquier wrote: >> So it seems that I am clearly outvoted here ;) >> >> Okay, let's do as you folks propose. > > And attached is a newer version with this isleaf stuff and the previous > feedback from

Re: pg_upgrade failed with ERROR: null relpartbound for relation 18159 error.

2018-10-05 Thread Amit Langote
Thanks for the report. On 2018/10/04 3:58, Rajkumar Raghuwanshi wrote: > Hi, > > I am getting ERROR: null relpartbound for relation 18159 while doing > pg_upgrade from v11 to v11/master. > > -- user-defined operator class in partition key > CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int

Re: partition tree inspection functions

2018-10-05 Thread Pavel Stehule
pá 5. 10. 2018 v 7:57 odesílatel Michael Paquier napsal: > On Thu, Oct 04, 2018 at 05:18:07PM +0900, Michael Paquier wrote: > > So it seems that I am clearly outvoted here ;) > > > > Okay, let's do as you folks propose. > > And attached is a newer version with this isleaf stuff and the previous