From: <novikov(at)webclub(dot)ru>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject:
Date: 1999-01-27 10:52:35
Message-ID: 4578.990127@webclub.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello.

Before SERIAL type appeared I used INTEGER, so it was easy
to add instance which is stored not in one table. Now when I
have a primary key of SERIAL type I do not know how to add
data to multiple tables (and even to one table too :)

For instance I have:
create table companies(
id serial primary key,
...
);
create table ccats(
cid integer not null references companies(id),
catid integer not null references categories(id)
);

What do I have to put instead of ??:
insert into companies values (??, ...);
insert into ccats (??, 5);
...
insert into ccats (??, 7);

Andrey.

Responses

  • Re: at 1999-01-27 11:22:22 from Herouth Maoz
  • Re: your mail at 1999-01-27 11:53:05 from Brian Baquiran

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1999-01-27 11:22:22 Re:
Previous Message hgati 1999-01-27 01:57:43 subscribe pgsql-admin