Re: in the different schema ,the sequence name is same, and a table's column definition use this sequence,so,how can I identify sequence's schema name by system view/table:

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: yanliang lei <msdnchina(at)163(dot)com>
Cc: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: in the different schema ,the sequence name is same, and a table's column definition use this sequence,so,how can I identify sequence's schema name by system view/table:
Date: 2025-10-01 12:20:34
Message-ID: CAKFQuwaHbepRV5PRb-J-uTgJRSWCsdPXM3SY5KivVPa+y2xM7w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wednesday, October 1, 2025, yanliang lei <msdnchina(at)163(dot)com> wrote:
>
> dbversion180=# create table schema_1.test_tab_100(c1 int default
> nextval('seq_xx_yy'));
>

Since you didn’t schema qualify the sequence name every single time a
default value is created the sequence will be looked up anew. The stored
expression is not associated with any specific object.

This is also why there is a separate step to mark a sequence as being owned
by a table. That establishes a dependency that this textual form is unable
to do.

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2025-10-01 12:38:12 Re: in the different schema ,the sequence name is same, and a table's column definition use this sequence,so,how can I identify sequence's schema name by system view/table:
Previous Message Greg Sabino Mullane 2025-10-01 11:07:57 Re: in the different schema ,the sequence name is same, and a table's column definition use this sequence,so,how can I identify sequence's schema name by system view/table: