Andreas Joseph Krogh <[EMAIL PROTECTED]> writes:
> Needless to say that it would be nice if this information was available in
> the information_schema, I'm probably not the only one spending lots of time
> in there. It's probably not in in the standard, but i would be a nice
> PG-extention to al
On Friday 07 November 2008 21:09:33 Tom Lane wrote:
> Andreas Joseph Krogh <[EMAIL PROTECTED]> writes:
> > AFAICS this lists all tables which have a column named '?', which is not
> > what I'm after. I'm after listing all columns referencing a certain column
> > as a FOREIGN KEY.
>
> Should be p
Andreas Joseph Krogh <[EMAIL PROTECTED]> writes:
> AFAICS this lists all tables which have a column named '?', which is not what
> I'm after. I'm after listing all columns referencing a certain column as a
> FOREIGN KEY.
Should be possible to dredge that out of pg_constraint ... about like
this:
On Friday 07 November 2008 15:15:49 paulo matadr wrote:
> Try this
>
> select table_schema, table_name
> from information_schema.columns
> where table_schema not in
> ('information_schema','pg_catalog')
> and column_name = '?'
AFAICS this lists all tables which have a column named '?', which is n
sql.org
Enviadas: Quinta-feira, 6 de Novembro de 2008 19:35:23
Assunto: [SQL] Finding all tables that have foreign keys referencing a table
Hi.
I see the last comment here suggests a solution for $subject:
http://www.postgresql.org/docs/8.1/interactive/ddl-constraints.html
But it turns out it assu
Hi.
I see the last comment here suggests a solution for $subject:
http://www.postgresql.org/docs/8.1/interactive/ddl-constraints.html
But it turns out it assumes constraint_name is unique, which is not the case.
It is only unique pr. table. In other words, it produces a lot of false results.
I'm