Re: [HACKERS] Open 6.4 items - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Open 6.4 items
Date
Msg-id 35E2D91B.52E75E76@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] Open 6.4 items  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Open 6.4 items  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] Open 6.4 items  (Peter T Mount <peter@retep.org.uk>)
List pgsql-hackers
> > > SERIAL type auto-creates sequence
> > I won't have time to do this for v6.4.
> This would be nice to have, so maybe we can jam it in.  If it is not
> 100% correct, we have a month to make it correct, right?

OK, I've committed the SERIAL type support to the CVS tree:

postgres=> create table test (x text, s serial);
NOTICE:  CREATE TABLE will create implicit sequence test_s_seq for
SERIAL column test.s
NOTICE:  CREATE TABLE/UNIQUE will create implicit index test_s_key for
table test
CREATE
postgres=> insert into test values ('one');
INSERT 894781 1
postgres=> insert into test values ('two');
INSERT 894782 1
postgres=> insert into test values ('three');
INSERT 894783 1
postgres=> select * from test;
x    |s
-----+-
one  |1
two  |2
three|3
(3 rows)

postgres=> \d

Database    = postgres
 +------------------+----------------------------------+----------+
 |  Owner           |             Relation             |   Type   |
 +------------------+----------------------------------+----------+
 | postgres         | test                             | table    |
 | postgres         | test_s_key                       | index    |
 | postgres         | test_s_seq                       | sequence |
 +------------------+----------------------------------+----------+
postgres=> select * from test;
x    |s
-----+-
one  |1
two  |2
three|3
(3 rows)

postgres=> \d
pqReadData() -- backend closed the channel unexpectedly.

Whoops! Don't know why this is causing trouble, but it seems to be
reproducible. Will look at it some more...

                     - Tom

pgsql-hackers by date:

Previous
From: Sferacarta Software
Date:
Subject: DATABASE CORRUPTION
Next
From: Michael Meskes
Date:
Subject: Re: [HACKERS] initdb problem