Problems w. SERIAL - Mailing list pgsql-general

From Morten Primdahl
Subject Problems w. SERIAL
Date
Msg-id 3AF4398E.48930FBB@primdahl.net
Whole thread Raw
Responses Re: Problems w. SERIAL  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Problems w. SERIAL  (Joel Burton <jburton@scw.org>)
List pgsql-general
Hi.

Have the following tables:

CREATE TABLE tbl_a (id SERIAL PRIMARY KEY, data VARCHAR(5));
CREATE TABLE tbl_b (id SERIAL PRIMARY KEY, data VARCHAR(5));

CREATE TABLE tbl_c
 (id SERIAL PRIMARY KEY,
  data VARCHAR(50),
  a SERIAL CONSTRAINT a_ref REFERENCES tbl_a(id),
  b SERIAL CONSTRAINT b_ref REFERENCES tbl_b(id)
);

The two inserts into tbl_a and tbl_b work fine:

INSERT INTO tbl_a (data) VALUES ('a data');
INSERT INTO tbl_b (data) VALUES ('b data');

But if I do

INSERT INTO tbl_c (data, a, b) VALUES ('c data',1,1);

I get ERROR:  Relation 'tbl_c_id_seq' does not exist
even though that sequence was implicitly created upon
creation of tbl_c - or?

Can anyone help me out on this? Thanks.

Morten

pgsql-general by date:

Previous
From: Ian Harding
Date:
Subject: Re: nested if , and how to trigger....
Next
From:
Date:
Subject: Re: are there plans for a threaded alternative to multiple daemons?