Re: [PATCH] Add schema and table names to partition error

2020-03-22 Thread Amit Kapila
On Fri, Mar 20, 2020 at 12:22 PM Amit Kapila wrote: > > On Thu, Mar 19, 2020 at 3:34 PM Amit Langote wrote: > > > > > > > > What do you think? Anybody else has an opinion on whether to > > > back-patch this or not? > > > > As nobody except Chris complained about this so far, maybe no? > > > > Fa

Re: [PATCH] Add schema and table names to partition error

2020-03-19 Thread Amit Kapila
On Thu, Mar 19, 2020 at 3:34 PM Amit Langote wrote: > > Thank you Chris, Amit. > > On Thu, Mar 19, 2020 at 1:46 PM Amit Kapila wrote: > > On Thu, Mar 19, 2020 at 3:55 AM Chris Bandy wrote: > > > > > > > > > Sorry for these troubles. Attached are patches created using `git > > > format-patch -n -

Re: [PATCH] Add schema and table names to partition error

2020-03-19 Thread Amit Kapila
On Thu, Mar 19, 2020 at 8:21 PM Chris Bandy wrote: > > On 3/18/20 11:46 PM, Amit Kapila wrote: > > On Thu, Mar 19, 2020 at 3:55 AM Chris Bandy wrote: > >> > >> > >> Sorry for these troubles. Attached are patches created using `git > >> format-patch -n -v6` on master at 487e9861d0. > >> > > > > No

Re: [PATCH] Add schema and table names to partition error

2020-03-19 Thread Chris Bandy
On 3/18/20 11:46 PM, Amit Kapila wrote: > On Thu, Mar 19, 2020 at 3:55 AM Chris Bandy wrote: >> >> >> Sorry for these troubles. Attached are patches created using `git >> format-patch -n -v6` on master at 487e9861d0. >> > > No problem. I have extracted your code changes as a separate patch > (se

Re: [PATCH] Add schema and table names to partition error

2020-03-19 Thread Amit Langote
Thank you Chris, Amit. On Thu, Mar 19, 2020 at 1:46 PM Amit Kapila wrote: > On Thu, Mar 19, 2020 at 3:55 AM Chris Bandy wrote: > > > > > > Sorry for these troubles. Attached are patches created using `git > > format-patch -n -v6` on master at 487e9861d0. > > > > No problem. I have extracted you

Re: [PATCH] Add schema and table names to partition error

2020-03-18 Thread Amit Kapila
On Thu, Mar 19, 2020 at 3:55 AM Chris Bandy wrote: > > > Sorry for these troubles. Attached are patches created using `git > format-patch -n -v6` on master at 487e9861d0. > No problem. I have extracted your code changes as a separate patch (see attached) as I am not sure we want to add tests for

Re: [PATCH] Add schema and table names to partition error

2020-03-18 Thread Chris Bandy
On 3/18/20 6:56 AM, Amit Kapila wrote: > On Thu, Mar 12, 2020 at 7:46 PM Amit Kapila wrote: >> >> On Wed, Mar 11, 2020 at 8:51 PM Chris Bandy wrote: >>> >>> On 3/11/20 6:29 AM, Amit Kapila wrote: I have tried with git am as well, but it failed. I am not sure what is the reason. C

Re: [PATCH] Add schema and table names to partition error

2020-03-18 Thread Amit Kapila
On Thu, Mar 12, 2020 at 7:46 PM Amit Kapila wrote: > > On Wed, Mar 11, 2020 at 8:51 PM Chris Bandy wrote: > > > > On 3/11/20 6:29 AM, Amit Kapila wrote: > > > > > > I have tried with git am as well, but it failed. I am not sure what > > > is the reason. Can you please once check at your end? >

Re: [PATCH] Add schema and table names to partition error

2020-03-12 Thread Amit Kapila
On Wed, Mar 11, 2020 at 8:51 PM Chris Bandy wrote: > > On 3/11/20 6:29 AM, Amit Kapila wrote: > > > > I have tried with git am as well, but it failed. I am not sure what > > is the reason. Can you please once check at your end? > > Yes, sorry. This set (and v3 and v4) should work with -p0. Any f

Re: [PATCH] Add schema and table names to partition error

2020-03-11 Thread Chris Bandy
Amit, On 3/11/20 6:29 AM, Amit Kapila wrote: > On Tue, Mar 3, 2020 at 10:05 AM Chris Bandy wrote: >> >> On 3/1/20 10:09 PM, Amit Langote wrote: >>> Hi Chris, >>> >>> On Mon, Mar 2, 2020 at 8:51 AM Chris Bandy wrote: On 3/1/20 5:14 AM, Amit Kapila wrote: > On Sun, Mar 1, 2020 at 10:10 AM

Re: [PATCH] Add schema and table names to partition error

2020-03-11 Thread Amit Kapila
On Tue, Mar 3, 2020 at 10:05 AM Chris Bandy wrote: > > On 3/1/20 10:09 PM, Amit Langote wrote: > > Hi Chris, > > > > On Mon, Mar 2, 2020 at 8:51 AM Chris Bandy wrote: > >> On 3/1/20 5:14 AM, Amit Kapila wrote: > >>> On Sun, Mar 1, 2020 at 10:10 AM Amit Langote > >>> wrote: > > There a

Re: [PATCH] Add schema and table names to partition error

2020-03-03 Thread Amit Kapila
On Wed, Mar 4, 2020 at 10:48 AM Chris Bandy wrote: > > On 3/3/20 10:08 AM, Alvaro Herrera wrote: > >> +\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: 23

Re: [PATCH] Add schema and table names to partition error

2020-03-03 Thread Chris Bandy
On 3/3/20 10:08 AM, Alvaro Herrera wrote: +\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 f

Re: [PATCH] Add schema and table names to partition error

2020-03-03 Thread Alvaro Herrera
> +\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

Re: [PATCH] Add schema and table names to partition error

2020-03-02 Thread Chris Bandy
On 3/1/20 10:09 PM, Amit Langote wrote: Hi Chris, On Mon, Mar 2, 2020 at 8:51 AM Chris Bandy wrote: On 3/1/20 5:14 AM, Amit Kapila wrote: On Sun, Mar 1, 2020 at 10:10 AM Amit Langote wrote: There are couple more instances in src/backend/command/tablecmds.c where partition constraint is che

Re: [PATCH] Add schema and table names to partition error

2020-03-02 Thread Amit Kapila
On Mon, Mar 2, 2020 at 9:39 AM Amit Langote wrote: > > > > My (very limited) understanding is that partition > > "constraints" are entirely contained within pg_class.relpartbound of the > > partition. > > That is correct. > > > Are you suggesting that the table name go into the constraint name fie

Re: [PATCH] Add schema and table names to partition error

2020-03-01 Thread Amit Langote
Hi Chris, On Mon, Mar 2, 2020 at 8:51 AM Chris Bandy wrote: > On 3/1/20 5:14 AM, Amit Kapila wrote: > > On Sun, Mar 1, 2020 at 10:10 AM Amit Langote > > wrote: > >> This makes sense to me. Btree code which implements unique > >> constraints also does this; see _bt_check_unique() function in >

Re: [PATCH] Add schema and table names to partition error

2020-03-01 Thread Chris Bandy
Thank you both for look at this! On 3/1/20 5:14 AM, Amit Kapila wrote: On Sun, Mar 1, 2020 at 10:10 AM Amit Langote wrote: Hi Chris, On Sun, Mar 1, 2020 at 4:34 AM Chris Bandy wrote: Hello, I'm writing telemetry data into a table partitioned by time. When there is no partition for a parti

Re: [PATCH] Add schema and table names to partition error

2020-03-01 Thread Amit Kapila
On Sun, Mar 1, 2020 at 10:10 AM Amit Langote wrote: > > Hi Chris, > > On Sun, Mar 1, 2020 at 4:34 AM Chris Bandy wrote: > > Hello, > > > > I'm writing telemetry data into a table partitioned by time. When there > > is no partition for a particular date, my app notices the constraint > > violation

Re: [PATCH] Add schema and table names to partition error

2020-02-29 Thread Amit Langote
Hi Chris, On Sun, Mar 1, 2020 at 4:34 AM Chris Bandy wrote: > Hello, > > I'm writing telemetry data into a table partitioned by time. When there > is no partition for a particular date, my app notices the constraint > violation, creates the partition, and retries the insert. > > I'm used to handl

[PATCH] Add schema and table names to partition error

2020-02-29 Thread Chris Bandy
for my use case: - Insert data into a partitioned table for which there is no partition. - Insert data directly into an incorrect partition. Thanks, Chris >From 8261b366c49b2d04baeb882d39dfa626b9315889 Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Sat, 29 Feb 2020 12:47:56 -0600 Subject: [PATCH] Ad