Skip site navigation (1) Skip section navigation (2)

Re: Alternative Serial

From: "Milen A(dot) Radev" <milen(at)radev(dot)net>
To: pgadmin-support(at)postgresql(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Alternative Serial
Date: 2007-03-11 16:54:32
Message-ID: et1c74$6f0$1@sea.gmane.org (view raw or flat)
Thread:
Lists: pgadmin-supportpgsql-sql
Ezequias Rodrigues da Rocha написа:
> Yes you are right, I means sequences.
> 

Please re-read my reply!

> The second way is better for me that have Id (PK) fields not  defined  as
> Sequences. Now it is much more difficult to change the  type of my PK than

A field could not be defined as 'sequence', but as 'serial', because
'sequence' is a db object and 'serial' is a (pseudo-)type. The actual
type of a field defined as 'serial' is 'integer' (or 'bigint' in case of
'bigserial'). You could change the type of a field (defined as sequence
earlier) as easy as you could any other field. Or you could just change
its default value. Or anything else.

> define a Default value. I am just concerned about the consistency of this
> sequence. Could you make me more easy ?

What do you mean by 'consistency' here? Guaranteed uniqueness of the
numbers generated by the sequence? Pleas read the fine documentation
here - http://www.postgresql.org/docs/8.2/static/sql-createsequence.html.


> 
> And about the cast I have found ?
> 
> nextval('mySerial_id'::regclass)
> 
> I ask again. What is regclass ? What does it really is.

I already answered that one, please re-read my reply and the pages it
mentions.

[...]



-- 
Milen A. Radev


In response to

pgadmin-support by date

Next:From: QuanZongliangDate: 2007-03-12 02:48:50
Subject: Build wxWidgets-2.8.0 in Cygwin
Previous:From: A. KretschmerDate: 2007-03-11 16:53:36
Subject: Re: Alternative Serial

pgsql-sql by date

Next:From: Jonah H. HarrisDate: 2007-03-11 20:30:49
Subject: Re: There is acid without transactions ?
Previous:From: A. KretschmerDate: 2007-03-11 16:53:36
Subject: Re: Alternative Serial

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group