Resolving of reference/foreign keys

From: "Oliver Friedrich" <oliver(at)familie-friedrich(dot)de>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Resolving of reference/foreign keys
Date: 2002-03-19 13:57:39
Message-ID: BCEFLCEOHFPNLLAKKGAAOEFGCKAA.oliver@familie-friedrich.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,
PostgreSQL supports foreign/reference keys. Is it possible to check with
this references for existing entries that need an entry before delete it? A
example:

Table A has a field 'ID' and an field 'text', the table B has its own field
'ID', the field 'table_A_ID' and field 'name'. The field 'table_A_ID'
references to the field 'ID' of table A. Now i want to delete an entray in
table A, but only if there is no entry in table B that requiers this entry.
One solution would be, if i make a SELECT on table B with the ID of table A,
but if there are more than one referenced fields this would be ineffective.
So i want to send a query to table A, that resolves all reference or just
counts the amount of references. Is that possible?

Thanks,
Oliver

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Haeberlen 2002-03-19 18:42:47 Suggestion for an improvement... ("database" part missing in URI)
Previous Message Nick Fankhauser 2002-03-19 13:36:07 Re: HEEEELPPPPPPPPP!!!!!!!!!!!!