Re: [GENERAL] fields and foreign keys

2005-06-24 Thread mrix
Yeah, thanks! But I've already tried this approach, and it's not quite i need. Because as i understand foreign keys are built on indexes, so i get *index* and corresponding foreign key definition. Well then i have to find out what filed this index belongs to (assuming 1 field - 1 index)

Re: [GENERAL] fields and foreign keys

2005-06-24 Thread Michael Fuhr
On Thu, Jun 23, 2005 at 10:11:15PM -0700, mrix wrote: But I've already tried this approach, and it's not quite i need. Because as i understand foreign keys are built on indexes, so i get *index* and corresponding foreign key definition. Well then i have to find out what filed this index

Re: [GENERAL] fields and foreign keys

2005-06-24 Thread Michael Fuhr
[Please copy the mailing list on replies.] On Fri, Jun 24, 2005 at 05:52:46PM +0300, Marik wrote: But what i really need is field this constraint belongs to then... I'd like to have such result: CREATE TABLE foo (id integer PRIMARY KEY); CREATE TABLE bar (fooid integer NOT NULL REFERENCES

[GENERAL] fields and foreign keys

2005-06-23 Thread mrix
Hello! I'd like to know how can i get list of fields and corresponding foreign keys (referenced table and field). Thanks! ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] fields and foreign keys

2005-06-23 Thread Michael Fuhr
On Thu, Jun 23, 2005 at 01:34:28AM -0700, mrix wrote: I'd like to know how can i get list of fields and corresponding foreign keys (referenced table and field). For individual tables, client interfaces usually have a way to show the table definition. In psql, for example, you can use \d