public inbox for [email protected]
help / color / mirror / Atom feedRe: Two sequences associated with one identity column
2+ messages / 2 participants
[nested] [flat]
* Re: Two sequences associated with one identity column
@ 2025-10-30 08:55 Colin 't Hart <[email protected]>
2025-10-30 14:42 ` Re: Two sequences associated with one identity column Adrian Klaver <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Colin 't Hart @ 2025-10-30 08:55 UTC (permalink / raw)
To: Adrian Klaver <[email protected]>; +Cc: PostgreSQL General <[email protected]>
relname | relnamespace | relpersistence
--------------------------+--------------+----------------
<sequence1> | 524799410 | p
<sequence2> | 524799410 | p
(2 rows)
On Wed, 29 Oct 2025 at 17:28, Adrian Klaver <[email protected]> wrote:
>
> On 10/29/25 06:40, Colin 't Hart wrote:
> > As expected the dump contains:
> >
> > CREATE TABLE <schema>.<tablename> (
> > <other columns>,
> > id bigint NOT NULL
> > );
> >
> > <snip>
> >
> > --
> > -- Name: <sequence1>; Type: SEQUENCE; Schema: <schema>; Owner: <owner>
> > --
> >
> > ALTER TABLE <schema>.<tablename> ALTER COLUMN id ADD GENERATED ALWAYS
> > AS IDENTITY (
> > SEQUENCE NAME <schema>.<sequence1>
> > START WITH 1
> > INCREMENT BY 1
> > NO MINVALUE
> > NO MAXVALUE
> > CACHE 1
> > );
> >
> >
> > --
> > -- Name: <sequence2>; Type: SEQUENCE; Schema: <schema>; Owner: <owner>
> > --
> >
> > ALTER TABLE <schema>.<tablename> ALTER COLUMN id ADD GENERATED ALWAYS
> > AS IDENTITY (
> > SEQUENCE NAME <schema>.<sequence2>
> > START WITH 1
> > INCREMENT BY 1
> > NO MINVALUE
> > NO MAXVALUE
> > CACHE 1
> > );
>
> Just a wild guess. Assuming <schema> is the same, what is the output of:
>
> SELECT
> relname,
> relnamespace,
> relpersistence
> FROM
> pg_class
> WHERE
> relname IN ('<sequence1>', '<sequence2> ')
> AND relnamespace = '<schema>'::regnamespace;
>
>
> >
>
> > /Colin
> >
>
> --
> Adrian Klaver
> [email protected]
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Two sequences associated with one identity column
2025-10-30 08:55 Re: Two sequences associated with one identity column Colin 't Hart <[email protected]>
@ 2025-10-30 14:42 ` Adrian Klaver <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Klaver @ 2025-10-30 14:42 UTC (permalink / raw)
To: Colin 't Hart <[email protected]>; +Cc: PostgreSQL General <[email protected]>
On 10/30/25 01:55, Colin 't Hart wrote:
> relname | relnamespace | relpersistence
> --------------------------+--------------+----------------o
> <sequence1> | 524799410 | p
> <sequence2> | 524799410 | p
> (2 rows)
>
Well so much for that guess. I was exploring the idea that the sequence
may have been unlogged at some point and you had both a logged(p) and
unlogged(u) instance of each.
--
Adrian Klaver
[email protected]
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-10-30 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-10-30 08:55 Re: Two sequences associated with one identity column Colin 't Hart <[email protected]>
2025-10-30 14:42 ` Adrian Klaver <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox