Обсуждение: BUG #15601: ERRO TYPE SERIAL

Поиск
Список
Период
Сортировка

BUG #15601: ERRO TYPE SERIAL

От
PG Bug reporting form
Дата:
The following bug has been logged on the website:

Bug reference:      15601
Logged by:          Waltênio de Bessa Mendes
Email address:      walteniobessa@gmail.com
PostgreSQL version: 11.1
Operating system:   Win 10
Description:

ALTER TABLE documento ALTER COLUMN id_doc TYPE SERIAL;

ERROR:  type "serial" does not exist
********** Error **********

ERROR: type "serial" does not exist
SQL state: 42704


Re: BUG #15601: ERRO TYPE SERIAL

От
Jeff Janes
Дата:
On Mon, Jan 21, 2019 at 4:26 PM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15601
Logged by:          Waltênio de Bessa Mendes
Email address:      walteniobessa@gmail.com
PostgreSQL version: 11.1
Operating system:   Win 10
Description:       

ALTER TABLE documento ALTER COLUMN id_doc TYPE SERIAL;

ERROR:  type "serial" does not exist
********** Error **********

ERROR: type "serial" does not exist
SQL state: 42704


This isn't a bug.


The data types smallserial, serial and bigserial are not true types, but merely a notational convenience for creating unique identifier columns (similar to the AUTO_INCREMENT property supported by some other databases) 

Further down, it tells you how to turn an existing column into that behaves just as if you had created it with 'serial' in the first place.

Cheers,

Jeff

Re: BUG #15601: ERRO TYPE SERIAL

От
Waltênio de Bessa Mendes
Дата:
Thanks, I'll check it out. 

Em seg, 21 de jan de 2019 às 21:13, Jeff Janes <jeff.janes@gmail.com> escreveu:
On Mon, Jan 21, 2019 at 4:26 PM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15601
Logged by:          Waltênio de Bessa Mendes
Email address:      walteniobessa@gmail.com
PostgreSQL version: 11.1
Operating system:   Win 10
Description:       

ALTER TABLE documento ALTER COLUMN id_doc TYPE SERIAL;

ERROR:  type "serial" does not exist
********** Error **********

ERROR: type "serial" does not exist
SQL state: 42704


This isn't a bug.


The data types smallserial, serial and bigserial are not true types, but merely a notational convenience for creating unique identifier columns (similar to the AUTO_INCREMENT property supported by some other databases) 

Further down, it tells you how to turn an existing column into that behaves just as if you had created it with 'serial' in the first place.

Cheers,

Jeff