pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen A. Radev <milen@radev.net>
To: pgadmin-support@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: Alternative Serial
Date: Sun, 11 Mar 2007 18:54:32 +0200
Message-ID: <et1c74$6f0$1@sea.gmane.org> (raw)
In-Reply-To: <55c095e90703110808u567e9a1dr4d038b2b382b3a68@mail.gmail.com>
References: <55c095e90703110720o78dfcfeai2b31bbadf17582b7@mail.gmail.com>
	<et14pj$5u5$1@sea.gmane.org>
	<55c095e90703110808u567e9a1dr4d038b2b382b3a68@mail.gmail.com>

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




view thread (5+ messages)

Message-ID: <et1c74$6f0$1@sea.gmane.org>
Permalink:  ../et1c74$6f0$1@sea.gmane.org/
Also on:    postgresql.org/message-id/et1c74$6f0$1@sea.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: milen@radev.net, pgadmin-support@postgresql.org
  Subject: Re: Alternative Serial
  In-Reply-To: <et1c74$6f0$1@sea.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox