Re: serial and namespace

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: serial and namespace
Date: 2002-04-02 06:37:51
Message-ID: 22583.1017729471@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> writes:
> # create table inoue.t1 (id serial primary key, dt text);
> NOTICE: CREATE TABLE will create implicit sequence 't1_id_seq'
> for SERIAL column 't1.id'
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
> 't1_pkey' for table 't1'
> CREATE
> # insert into inoue.t1 (dt) values ('abc');
> ERROR: Relation "t1_id_seq" does not exist

Okay, I fixed SERIAL column creation so that you get a default like
this:

regression=# \d t1
Table "t1"
Column | Type | Modifiers
--------+---------+-------------------------------------------------------
id | integer | not null default nextval('"inoue"."t1_id_seq"'::text)
dt | text |
Indexes: t1_pkey primary key btree (id)

I'm not entirely thrilled with this solution, because it forecloses the
possibility of dumping the table definition and then reloading it into
a different schema. We haven't yet talked much about how pg_dump should
behave with schemas --- but I think it will be important for pg_dump to
be able to choose whether to qualify object names with a schema name or
not in its dump output. The above approach makes it harder to do so.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Albert Chin 2002-04-02 06:39:32 Re: Autoconf upgraded
Previous Message Hiroshi Inoue 2002-04-02 04:39:57 serial and namespace