Re: Identifying Schema-Qualified Sequence References in Column Defaults - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Identifying Schema-Qualified Sequence References in Column Defaults
Date
Msg-id 1209719.1761187210@sss.pgh.pa.us
Whole thread Raw
In response to Identifying Schema-Qualified Sequence References in Column Defaults  (jiaoshuntian@highgo.com)
List pgsql-hackers
jiaoshuntian@highgo.com.w.kunlunaq.com writes:
> I'd like to bring attention to a metadata visibility issue when multiple schemas contain sequences with identical
names,and a table column references one of them via nextval(). Currently, there appears to be no reliable way to
determinewhich schema's sequence is actually referenced through system catalogs or views. 

The documented behavior of type regclass is that it schema-qualifies
the output name if the table/sequence/whatever would not be found by
searching the current search_path.  If you want something more
predictable, you could "set search_path = pg_catalog" before
inspecting the system catalogs.

            regards, tom lane



pgsql-hackers by date:

Previous
From: jiaoshuntian@highgo.com
Date:
Subject: Identifying Schema-Qualified Sequence References in Column Defaults
Next
From: Chao Li
Date:
Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part