Re: Table partitioning with sequence field in postgresql12

From: amul sul <sulamul(at)gmail(dot)com>
To: Srinivasa T N <seenutn(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Table partitioning with sequence field in postgresql12
Date: 2020-06-18 07:00:55
Message-ID: CAAJ_b96sP_SaNU1-NqHof_ZbgG-3tatWyiQ8YG8K7xyZ4FCajw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 18, 2020 at 12:22 PM Srinivasa T N <seenutn(at)gmail(dot)com> wrote:
>
> Hi,
> I have a parent table with one of the field as ""gid" int4 DEFAULT nextval('"ami_smart_new".aoi_boundary_gid_seq'::regclass)".
>
> I create child tables which inherit parent and use hash partition. When I directly insert into child tables, will there be any race condition causing two child tables getting the same sequence value for gid?
>
if "gid" is the partitioning key and assuming you are using declarative
partitioning[1], then it won't be possible to have the same "gid" value in two
child partitions.

1] https://www.postgresql.org/docs/current/ddl-partitioning.html

regards,
Amul

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Srinivasa T N 2020-06-18 07:03:52 Re: Table partitioning with sequence field in postgresql12
Previous Message Tim Cross 2020-06-18 06:57:42 Re: Table partitioning with sequence field in postgresql12