Thread: Can we refer to the column names as FK??

Can we refer to the column names as FK??

From
Anil Jangam
Date:
Hi,

This is to check whether we can refer to column names as FK reference??

So far when we define FK relation ship, we select the 'Local Column' and the
'Referenced Column'. Here essentially, the FK points to the contents/values
entered under the given column name in the table (Correct me if I am wrong).

Now if it is required to have column name itself as a reference AND NOT the
*content* of the column, is it possible?? I am stuck with a similar
requirement/situation.

thanks in advance,
regds,
-anil.

Re: Can we refer to the column names as FK??

From
Dave Page
Date:

> -----Original Message-----
> From: Anil Jangam [mailto:anilj@indts.com]
> Sent: 19 December 2001 07:33
> To: 'Dave Page'
> Cc: pgsql-cygwin@postgresql.org
> Subject: [CYGWIN] Can we refer to the column names as FK??
> Importance: High
>
>
> Hi,
>
> This is to check whether we can refer to column names as FK
> reference??
>
> So far when we define FK relation ship, we select the 'Local
> Column' and the 'Referenced Column'. Here essentially, the FK
> points to the contents/values entered under the given column
> name in the table (Correct me if I am wrong).
>
> Now if it is required to have column name itself as a
> reference AND NOT the
> *content* of the column, is it possible?? I am stuck with a
> similar requirement/situation.

It is not directly possible, though the system table pg_attribute contains
all the column definitions as data, and the view pg_tables contains all the
table info so you might be able to do something with them.

Regards, Dave.