Thread: Primary Key: How Do I Generate One For Insert ...

Primary Key: How Do I Generate One For Insert ...

From
Jim
Date:
Hello,

How do I generate a primary key (that is an INTEGER) to insert data into
a table. Or do I need to know whats used?

I am sure there is a way to get this info ;-) I just haven't found it yet.

Thanks in advance,
Jim


Re: Primary Key: How Do I Generate One For Insert ...

From
Stephan Szabo
Date:
On Sun, 4 Aug 2002, Jim wrote:

> Hello,
>
> How do I generate a primary key (that is an INTEGER) to insert data into
> a table. Or do I need to know whats used?

If you want an autogenerated one (ie, you don't have values you want to
insert specifically), you probably want to look at serial and sequences.