¿Cómo se cambia el tipo de columna y también se configura esa columna en not null
conjunto?
Estoy intentando:
ALTER TABLE mytable ALTER COLUMN col TYPE character varying(15) SET NOT NULL
Esto devuelve un error.
¿Cuál es la sintaxis correcta?
¿Cómo se cambia el tipo de columna y también se configura esa columna en not null
conjunto?
Estoy intentando:
ALTER TABLE mytable ALTER COLUMN col TYPE character varying(15) SET NOT NULL
Esto devuelve un error.
¿Cuál es la sintaxis correcta?
Respuestas:
Esto debería ser correcto:
ALTER TABLE mytable
ALTER COLUMN col TYPE character varying(15),
ALTER COLUMN col SET NOT NULL