[postgis-users] Cant create a BIGINT column that worked under another login at one point . . .
Stephen Woodbridge
woodbri at swoodbridge.com
Thu Mar 15 14:05:23 PDT 2012
Bob,
Do this instead:
CREATE TABLE cmdstpinfo
(
cmdrecid bigserial NOT NULL,
updsw smallint,
rxtime timestamp without time zone DEFAULT now(),
cmd text,
CONSTRAINT cmdstpinfo_pkey PRIMARY KEY (cmdrecid)
)
WITH ( OIDS=FALSE );
If you use type serial or bigserial, it will create an int or bigint
respectively and create the sequence.
more below ...
On 3/15/2012 3:19 PM, Bob Basques wrote:
> All,
>
>
> I have this sequence:
>
>
> CREATE SEQUENCE cmdstpinfo_cmdrecid_seq
>
> INCREMENT 1
>
> MINVALUE 1
>
> MAXVALUE 9223372036854775807
>
> START 132894
>
> CACHE 1;
>
> ALTER TABLE cmdstpinfo_cmdrecid_seq
>
> OWNER TO gismo;
>
>
> and I'm trying to create this table:
>
>
> CREATE TABLE cmdstpinfo
>
> (
>
> cmdrecid bigint NOT NULL DEFAULT
> nextval('cmdstpinfo_cmdrecid_seq'::regclass),
Use double quotes for object names, ie:
nextval("cmdstpinfo_cmdrecid_seq"::regclass),
single quotes are for text strings. This is probably what caused your error.
-Steve
> updsw smallint,
>
> rxtime timestamp without time zone DEFAULT now(),
>
> cmd text,
>
> CONSTRAINT cmdstpinfo_pkey PRIMARY KEY (cmdrecid)
>
> )
>
> WITH (
>
> OIDS=FALSE
>
> );
>
>
> but get the following error, if I remove the "cmdrecid" column creation
> line, I get the same error but for the smallint on "updsw" on the next
> line down :
>
>
> ERROR: syntax error at or near "bigint"
>
> LINE 3: cmdrecid bigint NOT NULL DEFAULT nextval('cmdstpinfo_cmdre...
>
> ^
>
> ********** Error **********
>
>
> ERROR: syntax error at or near "bigint"
>
> SQL state: 42601
>
> Character: 38
>
>
> What am I doing wrong, Is this a permissions error of some sort?
>
>
> Thanks
>
>
> bobb
>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list