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: - Mailing list pgsql-docs

From David G. Johnston
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
Msg-id CAKFQuwaHbepRV5PRb-J-uTgJRSWCsdPXM3SY5KivVPa+y2xM7w@mail.gmail.com
Whole thread Raw
In response to 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:  ("yanliang lei" <msdnchina@163.com>)
Responses 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:
List pgsql-docs
On Wednesday, October 1, 2025, yanliang lei <msdnchina@163.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.

pgsql-docs by date:

Previous
From: Greg Sabino Mullane
Date:
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:
Next
From: "David G. Johnston"
Date:
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: