RE: [HACKERS] AUTOINDEXING AND HOROLOGY REGRESSION ERROR ON PGSQL 6.3, LINUX-ELF i686

Поиск
Список
Период
Сортировка
От Jackson, DeJuan
Тема RE: [HACKERS] AUTOINDEXING AND HOROLOGY REGRESSION ERROR ON PGSQL 6.3, LINUX-ELF i686
Дата
Msg-id F10BB1FAF801D111829B0060971D839F18D396@dal_cps.cpsgroup.com
обсуждение исходный текст
Список pgsql-hackers
Redirected to Questions list.  (It is cool to say that.)

> -----Original Message-----
> hello all,
>
> yep, i'm new to postgres so please bare with me.  if this isn't the
> correct place to ask these questions, please point me in the right
> direction.
I know how you feel.

> first and foremost,
>
> i need to have a field (say pin) that is the primary key of a given
> relation.  each time a record gets added to this relation, the pin
> increases by 1.  thus making an auto increasing primary key (i.e. a
> unique identifier for each record that isn't explicitly increased by
> 1,
> the dbms does it for me.)
What you are looking for is a sequence.  Try
man create_sequence (or '\h create sequence' in psql).
ex.
 create sequence myseq start 0 minvalue 0 cycle;
 create table mytbl (
  mykey int4 default nextval('myseq') primary key,
  mydata1 varchar(20),
  ...);
when you do an insert you'll have to explicitly skip mykey.
ex.
 insert into mytbl(mydata1, ...)
  values ('Hello, world');

> second,
>
> i have a platform related installation question, which list should be
> used.
I'll let someone else answer this on from fear of being wrong.

> thankx,
>
> -brian (postgres@peanuts.roanoke.edu)
>
    -DEJ

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dwayne Bailey
Дата:
Сообщение: Alpha initdb fixed!
Следующее
От: dg@illustra.com (David Gould)
Дата:
Сообщение: Re: [HACKERS] Re: [PATCHES] patches for 6.2.1p6