pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Chris Bandy <bandy.chris@gmail.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] Add schema and table names to partition error
Date: Tue, 3 Mar 2020 13:08:46 -0300
Message-ID: <20200303160846.GA2728@alvherre.pgsql> (raw)
In-Reply-To: <0acc36c9-1aef-1057-0c29-de473c850605@gmail.com>

> +\set VERBOSITY verbose
> +-- no partitions
> +CREATE TABLE pterr1 (x int, y int, PRIMARY KEY (x, y)) PARTITION BY RANGE (y);
> +INSERT INTO pterr1 VALUES (10, 10);
> +ERROR:  23514: no partition of relation "pterr1" found for row
> +DETAIL:  Partition key of the failing row contains (y) = (10).
> +SCHEMA NAME:  public
> +TABLE NAME:  pterr1
> +LOCATION:  ExecFindPartition, execPartition.c:349

This won't work well, because people would be forced to update the .out
file whenever the execPartition.c file changed to add or remove lines
before the one with the error call.  Maybe if you want to verify the
schema/table names, use a plpgsql function to extract them, using
GET STACKED DIAGNOSTICS TABLE_NAME = ...
in an exception block?

I'm not sure that this *needs* to be tested, though.  Don't we already
verify that errtable() works, elsewhere?  I don't suppose you mean to
test that every single ereport() call that includes errtable() contains
a TABLE NAME item.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (24+ messages)  latest in thread

Message-ID: <20200303160846.GA2728@alvherre.pgsql>
Permalink:  ../20200303160846.GA2728@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200303160846.GA2728@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, bandy.chris@gmail.com, amitlangote09@gmail.com, amit.kapila16@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: [PATCH] Add schema and table names to partition error
  In-Reply-To: <20200303160846.GA2728@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox