Error con SERIAL (auto_increment)
Publicado por Tomas (5 intervenciones) el 28/08/2016 14:10:08
Hola, estoy intentando usar lo que en mysql es Auto_increment, en postgre Serial, pero me da el siguiente error. Estoy trabajando con postgre 9.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CREATE TYPE FAMILIA AS(
id int,
nombre VARCHAR(35),
ruta_imagen VARCHAR(150));
CREATE TABLE FAMILIAS of FAMILIA(
id serial primary key NOT NULL,
nombre NOT NULL
);
ERROR: syntax error at or near "serial"
LINE 7: id serial primary key NOT NULL,
^
********** Error **********
ERROR: syntax error at or near "serial"
SQL state: 42601
Valora esta pregunta


0