From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Marcelo Robin <marcelorobin(at)gmail(dot)com> |
Cc: | Julio Cesar Rodriguez Dominguez <jurasec(at)gmail(dot)com>, iescriva <iescriva(at)gmail(dot)com>, pgsql-es-ayuda <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: CAMPO SERIAL... |
Date: | 2011-05-03 14:02:12 |
Message-ID: | 1304431245-sup-357@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Excerpts from Marcelo Robin's message of mar may 03 10:51:18 -0300 2011:
> Tomando como default me lo toma como serial ?
Sí (si es que el default es el nextval de la secuencia).
> Estaba viendo que tengo el id definido de otra forma...
>
> CREATE TABLE com.bultos
> (
> id bigint NOT NULL,
> bulto text,
> bulto_corto text,
> CONSTRAINT bultos_pkey PRIMARY KEY (id)
> )
> WITHOUT OIDS;
> ALTER TABLE com.bultos OWNER TO ariel;
> GRANT ALL ON TABLE com.bultos TO ariel WITH GRANT OPTION;
> GRANT ALL ON TABLE com.bultos TO public;
Más abajo debería haber un CREATE SEQUENCE y un ALTER SEQUENCE .. OWNED
BY además de un ALTER COLUMN / SET DEFAULT que ligan la secuencia con la
columna. Eso hace que el campo sea SERIAL.
--
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
From | Date | Subject | |
---|---|---|---|
Next Message | Harold Alexander Onore Harold | 2011-05-03 14:42:29 | data_directory |
Previous Message | Julio Cesar Rodriguez Dominguez | 2011-05-03 14:01:51 | Re: CAMPO SERIAL... |