Tom Lane schrieb am 18.10.2016 um 15:20:
>> Furthermore, what's stored in the column seems to be a string of the
>> format "nextval('sequencename'::regclass)". Is there a function to
>> parse this, to return just the sequence name, or will the sequence
>> name always be without for instance a schema name so that a naive
>> parser of our own will do? Googling found no candidates.
>
> Personally, I'd try looking in pg_depend to see if the column's default
> expression has a dependency on a relation of type sequence. That avoids
> all the fun of parsing the expression and turns it into a simple SQL
> join problem.
I thought pg_depend only stores the dependency if the the sequence was assigned
an owning column (through OWNED BY).
I don't see any entries in pg_depend for a simple "default nextval('some_sequence')" expression
but maybe I am just missing something.
Thomas