Re: syncing a serial across tables

From: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
To: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: syncing a serial across tables
Date: 2005-05-12 18:02:31
Message-ID: 7104a737050512110218bb26c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

On 5/12/05, Keith Worthington <keithw(at)narrowpathinc(dot)com> wrote:
> I believe I need to use a serial column in two tables and keep then synched.
> I am thinking that I could use an AFTER INSERT trigger and INSERT currval()
> into the second table to keep them synched. Has anyone done this before? Is
> this a bad idea?

If both columns in both table will have the same value, why don't you
just reference one to another? This will keep synchorization
automaticly.

Regards.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-05-12 18:14:15 Re: syncing a serial across tables
Previous Message Keith Worthington 2005-05-12 17:48:02 syncing a serial across tables