Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: sequences a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15648 of 17437
Post > Topic >>

Re: sequences and dependences

by ioannis@[EMAIL PROTECTED] (Ioannis Tambouras) May 24, 2008 at 11:06 AM

>   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

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 1 Posts in Topic:
Re: sequences and dependences
ioannis@[EMAIL PROTECTED]  2008-05-24 11:06:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:37:27 CST 2008.