pgsql: Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/RO

2019-03-21 Thread Tom Lane
Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/ROUTINE. These commands allow the argument type list to be omitted if there is just one object that matches by name. However, if that syntax was used with DROP IF EXISTS and there was more than one match, you got a "function ... does n

pgsql: Fix dependency recording bug for partitioned PKs

2019-03-21 Thread Alvaro Herrera
Fix dependency recording bug for partitioned PKs When DefineIndex recurses to create constraints on partitions, it needs to use the value returned by index_constraint_create to set up partition dependencies. However, in the course of fixing the DEPENDENCY_INTERNAL_AUTO mess, commit 1d92a0c9f7dd i

pgsql: Catversion bump announced in previous commit but forgotten

2019-03-21 Thread Alvaro Herrera
Catversion bump announced in previous commit but forgotten Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/03ae9d59bd5f5ef9a1cb387568e5cbf12b9c7b10 Modified Files -- src/include/catalog/catversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Revert "Suppress DETAIL output from a foreign_data test."

2019-03-21 Thread Peter Geoghegan
Revert "Suppress DETAIL output from a foreign_data test." This should be superseded by commit 8aa9dd74. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fff518d051285bc47e2694a349d410e01972730b Modified Files -- src/test/regress/expected/foreign_data.out

Re: pgsql: Make heap TID a tiebreaker nbtree index column.

2019-03-21 Thread Peter Geoghegan
On Wed, Mar 20, 2019 at 8:17 PM Tom Lane wrote: > > Actually, I'm not sure why it would be fine to revert 7d3bf73ac now. > > Might the problem actually be the order in which OIDs are originally > > assigned, or something like that? > > No, because then things would have been unstable before, no?

Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Alvaro Herrera
On 2019-Feb-08, Michael Paquier wrote: > Add pg_partition_root to display top-most parent of a partition tree > > This is useful when looking at partition trees with multiple layers, and > combined with pg_partition_tree, it provides the possibility to show up > an entire tree by just knowing one

Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Michael Paquier
On Fri, Mar 22, 2019 at 12:26:12AM -0300, Alvaro Herrera wrote: > I noticed days ago that if you call pg_partition_root on the topmost > partitioned table, the server crashes :-) It's when you think that the thing is actually done that another issue pops up. The attached fixes the issue, I sugges

Re: [Suspect SPAM] Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Amit Langote
Hi, On 2019/03/22 12:55, Michael Paquier wrote: > On Fri, Mar 22, 2019 at 12:26:12AM -0300, Alvaro Herrera wrote: >> I noticed days ago that if you call pg_partition_root on the topmost >> partitioned table, the server crashes :-) I thought we already fixed that last month, but that was pg_partit

Re: [Suspect SPAM] Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Michael Paquier
On Fri, Mar 22, 2019 at 01:09:23PM +0900, Amit Langote wrote: > /* Fetch the top-most parent */ > ancestors = get_partition_ancestors(relid); > > Maybe, the patch should update this comment to say "Fetch the list of > ancestors". Perhaps so. Note that actually the list is fetched to

Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Amit Langote
Sorry about the messed up subject string of my previous reply. I failed to notice that our internal mailing software occasionally adds that to email headers before the emails get to my machine. I've been asked to be careful before, but I didn't notice it again today. :-( Thanks, Amit

Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Amit Langote
On 2019/03/22 13:12, Michael Paquier wrote: > On Fri, Mar 22, 2019 at 01:09:23PM +0900, Amit Langote wrote: >> /* Fetch the top-most parent */ >> ancestors = get_partition_ancestors(relid); >> >> Maybe, the patch should update this comment to say "Fetch the list of >> ancestors". > > Per

Re: pgsql: Add pg_partition_root to display top-most parent of a partition

2019-03-21 Thread Michael Paquier
On Fri, Mar 22, 2019 at 01:28:19PM +0900, Amit Langote wrote: > It looked fine before, but the new lines added by patch makes it look > wrong/misplaced somehow. Okay, what do you think about the attached then? -- Michael diff --git a/src/backend/utils/adt/partitionfuncs.c b/src/backend/utils/adt/p