data integrity - Mailing list pgsql-sql

From Sandis
Subject data integrity
Date
Msg-id 15604.000815@parks.lv
Whole thread Raw
Responses Re: data integrity  (Jesus Aneiros <aneiros@jagua.cfg.sld.cu>)
List pgsql-sql
Hello pgsql-sql,

sorry for my question that is obviously a kind of lame and not
related directly to postges, but i
never dealt with it before & need an idea what to do right now.

there is a db with a few tables that have related (joined) fields.
if record in a one table (auxiliary) gets deleted (along with it's primary key),
reference to it in another table (main) points to nowhere.
then doing a complex query with a join on that tables doesn't return
such corrupted rows that contains references to deleted rows in other
tables.

what's the solution? should i check if this 'project', for example,
have 'contacts' associated with it, and do not allow user to delete it,
than show that 'contacts' list and ask if she wants delete all of them?
or may be dont show a list, but just warn that there is $number
'contacts' related to this 'project', do you want to delete them all?

how about joins in delete query?
DELETE FROM projects, contacts WHERE projects.contact = contacts.id
AND projects.id = '$id';

he, i wrote the answer myself. may be dont send it at all?

can someone suggest some good online resource where such common sql topics
discussed?

thanks
--:)--
Best regards,Sandis                          mailto:sandisj@parks.lv




pgsql-sql by date:

Previous
From: "Adam Lang"
Date:
Subject: Re: copy from
Next
From: Jesus Aneiros
Date:
Subject: Re: data integrity