Ver Mensaje Individual
  #6 (permalink)  
Antiguo 27/04/2011, 16:05
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 2 meses
Puntos: 360
Respuesta: Se puede cambiar el orden de las columna en postgres?

Rivermillos...
Serial no es un tipo de campo. Simplemente es un integer que lleva por defecto una secuencia.

Mira la explicación en el manual de referencia
Cita:
The data types serial and bigserial are not true types, but merely a notational convenience for setting up unique identifier columns (similar to the AUTO_INCREMENT property supported by some other databases). In the current implementation, specifying

CREATE TABLE tablename (
colname SERIAL
);
is equivalent to specifying:

CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename (
colname integer DEFAULT nextval('tablename_colname_seq') NOT NULL
);
Thus, we have created an integer column and arranged for its default values to be assigned from a sequence generator. A NOT NULL constraint is applied to ensure that a null value cannot be explicitly inserted, either. In most cases you would also want to attach a UNIQUE or PRIMARY KEY constraint to prevent duplicate values from being inserted by accident, but this is not automatic.
Por lo que para hacer lo que buscas, primero tendrías que crear newsequence como objeto secuencia.

se entiende?
__________________
Without data, You are another person with an opinion.
W. Edwads Deming