Re: identity not working with inherited table

Поиск
Список
Период
Сортировка
От José Luis Viejo
Тема Re: identity not working with inherited table
Дата
Msg-id CAB1Cj4Nf3iMfXWvFSn7voq1h9udGKwrn7urC2B0=zGUMiPbAYw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: identity not working with inherited table  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: identity not working with inherited table  (Francisco Olarte <folarte@peoplecall.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: identity not working with inherited table
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: identity not working with inherited table