... - Mailing list pgsql-sql

From Àíäðåé Íîâèêîâ
Subject ...
Date
Msg-id 4578.990127@webclub.ru
Whole thread Raw
Responses Re:  (Herouth Maoz <herouth@oumail.openu.ac.il>)
Re: your mail  (Brian Baquiran <brianb@evoserve.com>)
List 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.



pgsql-sql by date:

Previous
From: "񊀔"
Date:
Subject: subscribe pgsql-admin
Next
From: Herouth Maoz
Date:
Subject: Re: