
Shouldn't this produce something?  Was talking with Dave Page today about
the lack of a serial type in PgAdmin, and he mentioned that its not a listed
type?


template1=> SELECT typname FROM pg_type WHERE typrelid = 0 and typname='serial';
 typname 
---------
(0 rows)


Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 


Thu, 3 Feb 2000 11:54:20 -0400 (AST)
The Hermit Hacker <scrappy@hub.org>
SERIAL type isn't listed...?
Serial isn't a type. The parser transforms it to int4 plus some default
and a sequence. There is a TODO item in this direction, but I think no one
is quite sure how/why/whether to do it.

On Thu, 3 Feb 2000, The Hermit Hacker wrote:

> 
> Shouldn't this produce something?  Was talking with Dave Page today about
> the lack of a serial type in PgAdmin, and he mentioned that its not a listed
> type?
> 
> 
> template1=> SELECT typname FROM pg_type WHERE typrelid = 0 and typname='serial';
>  typname 
> ---------
> (0 rows)
> 
> 
> Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
> Systems Administrator @ hub.org 
> primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 
> 
> 
> ************
> 
> 

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Thu, 3 Feb 2000 17:28:07 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: [HACKERS] SERIAL type isn't listed...?
> Shouldn't this produce something?  Was talking with Dave Page today about
> the lack of a serial type in PgAdmin, and he mentioned that its not a 
> listed type?

Right. That's because the SERIAL type is a parser kludge rather than a
full-fledged type. At the moment, a column defined as SERIAL becomes,
in the parser backend, a defined sequence (CREATE SEQUENCE ...) and an
INT4 column with a constraint of DEFAULT ... which refers to the
sequence just created.

There are downsides to this: the implicit SEQUENCE is not cleaned up
if the column is destroyed; explicit reference to SERIAL is lost
during dump/restore; the implicit stuff just leads to confusion, etc
etc etc.

Perhaps eventually it should become a type on its own, directly
accessing the same structures as Vadim's "sequence" code. Or perhaps
it could be done using the SPI interface.

                   - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California

Thu, 03 Feb 2000 16:31:47 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: [HACKERS] SERIAL type isn't listed...?
The Hermit Hacker wrote:
> 
> Shouldn't this produce something?  Was talking with Dave Page today about
> the lack of a serial type in PgAdmin, and he mentioned that its not a listed
> type?

On 6.5, serial is not a type, but is promoted to "int4 DEFAULT nextval (
'"sequence_name_here"' ) NOT NULL", generating the associated sequence
in the process.

Sevo

Thu, 03 Feb 2000 19:06:23 +0100
Sevo Stille <sevo@ip23.net>
Re: [HACKERS] SERIAL type isn't listed...?
The Hermit Hacker wrote:
> 
> Shouldn't this produce something?  Was talking with Dave Page today about
> the lack of a serial type in PgAdmin, and he mentioned that its not a listed
> type?

Does PgAdmin support VIEWs ? They don't really exist either.

----------------------
Hannu

Fri, 04 Feb 2000 01:00:28 +0200
Hannu Krosing <hannu@tm.ee>
Re: [HACKERS] SERIAL type isn't listed...?