Search Postgresql Archives

Re: sequences and dependences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>   I would like to write a request where I would get the table name and
>   column name of a sequence.
>   In fact I want the opposite of pg_get_serial_sequence !


You are looking for refobjid in pg_depend, but this
time the sequence could be a dependent to more than table.

A query like the one bellow is should give you the name of the table, 
assuming you account for the correct namespace; it will not automatically 
show the name of the column: 

select objid::regclass, refobjid::regclass
from pg_depend
where objid::regclass::text = 'person_id_seq' ;


Thanks
Ioannis Tambouras


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux