pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Trond Arve Nordheim <trond@nordheim.no>
To: pgsql-sql@postgresql.org
Subject: Automaticly delete related data
Date: 25 Nov 2001 03:10:26 +0100
Message-ID: <1006654229.11145.8.camel@geekpower> (raw)

Hi!

I'm developing a publishing system and are trying to create
functions/triggers that automaticly wipes out related data to the data
currently beeing deleted...

For example, I have a table containing site objects (an article or
whatever) where I have the following fields;

int_objectid SERIAL NOT NULL,
str_objecttitle VARCHAR(255) NOT NULL,
...
...

Then, I have a table defining the content of that data;
int_objectid INT(11) NOT NULL
str_data TEXT NOT NULL,
...
...

What I want to do is;
When I delete a row from the first table, I want all rows with mathing
int_objectid values in the second table to be deleted.

I've been reading in a couple of online books and the PostgreSQL
documentation all day without beeing able to make something of this...

Can anyone give me a hint, or point me in the direction of some
documentation that can help me out?

Sincerly,
Trond Arve Nordheim






view thread (3+ messages)  latest in thread

Message-ID: <1006654229.11145.8.camel@geekpower>
Permalink:  ../1006654229.11145.8.camel@geekpower/
Also on:    postgresql.org/message-id/1006654229.11145.8.camel@geekpower

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: trond@nordheim.no
  Subject: Re: Automaticly delete related data
  In-Reply-To: <1006654229.11145.8.camel@geekpower>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox