I have a sequence called seque_post.
I need to find out in what table it's being used. Is there a way to write a query that will give the table name?
I wrote this query to find the sequence:
select *
from pg_class
where relname like 'seque_post'
there is a filed there reltoastrelid which according to the manual gives:
OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes "out of line" in a secondary table.
but i'm not sure how to continue from here.. suggestions?
SerialorBigSerial), but can be the default for any number of other columns, or just used manually in some function somewhere.textcolumn) so is not relevant to this question.Serial, so if it's being used somewhere it's surly as PK for column. Since I don't know where it's being used I'll need to look up everywhere... But it's more likely to be used as PK for table... regarding the TOAST, as I said I don't really know how to solve this problem.. it was just a wild guess.