Search Postgresql Archives

Re: serial

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/12/4 Gustavo Rosso <grosso@xxxxxxxxxxxxx>:
> I created this table:
>
> create table se (n  serial);
>
> Column |  Type      |                   Modifiers
> ---------+---------+------------------------------------------------
> n           | integer    | not null default nextval('se_n_seq'::regclass)
>
> I inserted two record, later select, but column n (serial) no
> auto-incremented
> banco=# select * from se;
> n
> ---
> 0
> 0
> (2 rows)
>

what is your insert statement?

postgres=#
postgres=# create table se(n serial);
NOTICE:  CREATE TABLE will create implicit sequence "se_n_seq" for
serial column "se.n"
CREATE TABLE
postgres=# insert into se values(default);
INSERT 0 1
postgres=# insert into se values(default);
INSERT 0 1
postgres=# select * from se;
 n
---
 1
 2
(2 rows)

regards
Pavel Stehule

> Why?
> Thanks
> Gustavo
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux