Re: identity not working with inherited table - Mailing list pgsql-bugs

From José Luis Viejo
Subject Re: identity not working with inherited table
Date
Msg-id CAB1Cj4Nf3iMfXWvFSn7voq1h9udGKwrn7urC2B0=zGUMiPbAYw@mail.gmail.com
Whole thread Raw
In response to Re: identity not working with inherited table  (Michael Paquier <michael@paquier.xyz>)
Responses Re: identity not working with inherited table  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-bugs
Hi Michael

I'm using PostgreSQL 11 latest version, having problems with an identity as PK that inherits a table.

assume you have simple parent table like:

CREATE TABLE test7    (   id_t7 int GENERATED always AS IDENTITY PRIMARY KEY,   folio int GENERATED always AS IDENTITY,   client int   );

with any inherited table like:

CREATE TABLE test7_detail1
( --  uuid uuid DEFAULT uuid_generate_v4(), <-- fiddle doesn't support it   in_process boolean,   id_corte integer,   ts_captura timestamp(6) without time zone DEFAULT (now())::timestamp without time zone
) INHERITS (test7);

if I try insert like:

insert into test7_detail1 (client,in_process, id_corte)
values (20797,'t',101)

it returns:

ERROR:  null value in column "id_t7" violates not-null constraint
DETAIL:  Failing row contains (null, null, 20797, t, 101, 2019-05-03 22:27:54.823894).

here is the fiddle

thanks in advance, best regards

jose


On Sun, May 5, 2019 at 4:31 AM Michael Paquier <michael@paquier.xyz> wrote:
On Sat, May 04, 2019 at 12:11:51AM -0500, José Luis Viejo wrote:
> I hope this helps to clarify the problem
>
> https://stackoverflow.com/questions/55979456/identity-not-working-with-inherited-table

If Stack overflow goes away, then we would lost this information when
referring to the archives of PostgreSQL mailing lists, and not
everybody is willing to follow the information on the link.  Could you
send directly to this thread what you think the actual problem is,
what you are noticing, and what you would expect?  Using SQL queries
is of course recommended.
--
Michael

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: identity not working with inherited table
Next
From: Francisco Olarte
Date:
Subject: Re: identity not working with inherited table