Re: automatic numbering in a new column

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: ppdcc(at)sapo(dot)pt
Cc: pgadmin-support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: automatic numbering in a new column
Date: 2011-08-24 18:52:28
Message-ID: 1314211948.2193.39.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

A few comments before answering:
1. Don't top post. It makes it hard to read.
2. Reply to the list.
3. Choose your list more carefully. pgadmin-support is about pgAdmin
support, not about SQL.

This being said, I'll quickly answer your question...

On Wed, 2011-08-24 at 19:47 +0100, ppdcc(at)sapo(dot)pt wrote:
> and how i do that?
>
> cAN you make a example for me
>

CREATE TABLE t1 (c1 serial, c2 text);

c1 will be automatically numbered if you don't set a value for it. Just
like this: INSERT INTO t1 (c2) VALUES ('hello');

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Cuddihy, Joe 2011-08-25 20:21:04 admin
Previous Message Guillaume Lelarge 2011-08-24 18:43:04 Re: automatic numbering in a new column