pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <maillist@candle.pha.pa.us>
To: herouth@oumail.openu.ac.il
Cc: wwwadmin@wizard.ca
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] How to handle a requirement for nextval
Date: Tue, 19 May 1998 14:38:32 -0400 (EDT)
Message-ID: <199805191838.OAA21176@candle.pha.pa.us> (raw)
In-Reply-To: <l03110702b186e1a326b8@[147.233.159.109]>

Update FAQ.  See web site for new heading.

> 
> At 23:33 +0300 on 18/5/98, The Web Administrator wrote:
> 
> 
> > What I want is that the Primary Key (Only Key) be type_id, and int, and
> > the first item that I insert should have type_id as '1', next will be
> > '2'  etc..
> > I could have every insert into this table include a type_id, but that
> > seems unessary.
> > Can I have something like default='nextval' ?
> 
> This is so much a faq, that I went to look at the FAQ. In fact, there is a
> question there which is similar to this one, but I think its phrasing
> defeats newbies rather than helps them. I for one have never encountered
> fields of type SERIAL, and people might not think it's the same sort of
> question. The answer is even more of a problem, because the most commonly
> used method of doing this is summarised in "look at the create_sequence
> manual", whereas the two less recommended methods (using OIDs and using an
> auto-incrementing function) are discussed in detail.
> 
> Bruce, don't you agree? Perhaps change the phrasing of the question to "How
> do I create an auto-incrementing field?"


-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)



view thread (7+ messages)

Message-ID: <199805191838.OAA21176@candle.pha.pa.us>
Permalink:  ../199805191838.OAA21176@candle.pha.pa.us/
Also on:    postgresql.org/message-id/199805191838.OAA21176@candle.pha.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: maillist@candle.pha.pa.us, herouth@oumail.openu.ac.il, wwwadmin@wizard.ca
  Subject: Re: [SQL] How to handle a requirement for nextval
  In-Reply-To: <199805191838.OAA21176@candle.pha.pa.us>
  References: <l03110702b186e1a326b8@[147.233.159.109]> <199805191838.OAA21176@candle.pha.pa.us>

* 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