Resolving of reference/foreign keys - Mailing list pgsql-jdbc

From Oliver Friedrich
Subject Resolving of reference/foreign keys
Date
Msg-id BCEFLCEOHFPNLLAKKGAAOEFGCKAA.oliver@familie-friedrich.de
Whole thread Raw
Responses Re: Resolving of reference/foreign keys
List 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


pgsql-jdbc by date:

Previous
From: "Nick Fankhauser"
Date:
Subject: Re: HEEEELPPPPPPPPP!!!!!!!!!!!!
Next
From: Thomas Haeberlen
Date:
Subject: Suggestion for an improvement... ("database" part missing in URI)