data integrity

From: Sandis <sandisj(at)parks(dot)lv>
To: pgsql-sql(at)postgresql(dot)org
Subject: data integrity
Date: 2000-08-15 11:30:01
Message-ID: 15604.000815@parks.lv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)parks(dot)lv

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message DalTech - CTE 2000-08-15 12:12:58 Re: Functions with Null Arguments?
Previous Message Keith Wong 2000-08-15 11:29:33 8K Limit, whats the best strategy?