[postgis-users] Cant create a BIGINT column that worked under another login at one point . . .
Bob Basques
Bob.Basques at ci.stpaul.mn.us
Thu Mar 15 14:10:49 PDT 2012
Hi S,
Yeah I found all that out while trying to figure things.
It's some sort of permissions error, as in the old user/role has the correct permissioms to make it work, since I went back to the original user and all is well again. I'll need to figure it out though.
bobb
>>> Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
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
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120315/f226a933/attachment.html>
More information about the postgis-users
mailing list