Re: bigserial problem

From: rich(dot)morrison(at)atxinc(dot)com
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: pgadmin-support(at)postgresql(dot)org, pgadmin-support-owner(at)postgresql(dot)org
Subject: Re: bigserial problem
Date: 2005-10-04 17:53:16
Message-ID: OFDBC13D78.AA34D548-ON85257090.0061A44F-85257090.0062432D@atxforms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Thank you,

Richard Morrison
Sr. Software Engineer
ATX II, LLC
"In Rich We Trust!"

pgadmin-support-owner(at)postgresql(dot)org wrote on 10/04/2005 01:33:06 PM:

> rich(dot)morrison(at)atxinc(dot)com wrote:
> >
> > pgAdmin reports a SQL error when attempting to add a bigserial column
to
> > an existing table.
>
> I checked this, it works.

Are you using the same program version that I am? It fails on my computer
with the previously stated error. I'm using the US English, Win32, verion
1.2.2.0 build installed with the msi installer.

>
> >
> > Adding the column produces this SQL statement:
> >
> > CREATE SEQUENCE public.tblenglish_in_trnas_id_seq;
> > ALTER TABLE tblenglish_in
> > ADD COLUMN trnas_id int8;
> > ALTER TABLE tblenglish_in
> > ALTER COLUMN trnas_id SET DEFAULT
> > nextval('public.tblenglish_in_trnas_id_seq'::text);
> > INSERT INTO pg_depend(classid, objid, objsubid, refclassid, refobjid,
> > refobjsubid, deptype)
> > SELECT cl.oid, seq.oid, 0, cl.oid, 17154::oid, attnum, 'i'
> > FROM pg_class cl, pg_attribute, pg_class seq
> > JOIN pg_namespace sn ON sn.OID=seq.relnamespace
> > WHERE cl.relname='pg_class'
> > AND seq.rel
>
> Not quite. The resulting sql query can be taken from the SQL page of the

> dialog. What you present here is probably what's logged in pgadmin.log,
> which might get truncated to 1k (AFAIR) for technical reasons.

Nope. I copied the statement from the SQL tab from the properties dialog
of a table I created earlier.

I copied this one from the same dialog as well:

CREATE SEQUENCE public.tbltest_s_seq;
ALTER TABLE tbltest
ADD COLUMN s int8;
ALTER TABLE tbltest
ALTER COLUMN s SET DEFAULT nextval('public.tbltest_s_seq'::text);
INSERT INTO pg_depend(classid, objid, objsubid, refclassid, refobjid,
refobjsubid, deptype)
SELECT cl.oid, seq.oid, 0, cl.oid, 17474::oid, attnum, 'i'
FROM pg_class cl, pg_attribute, pg_class seq
JOIN pg_namespace sn ON sn.OID=seq.relnamespace
WHERE cl.relname='pg_class'
AND seq.relname='tbltest_s_seq'
AND sn.nspname='public'
ANDALTER TABLE tbltest
ADD COLUMN test varchar(30);

Notice the 'ANDALTER'? Part of the previous query is definately missing.

Clicking ok on the dialog gives the error: ERROR: syntax error at or near
"ANDALTER" at character 509.

Running the SQL statement in the SQL window gives the error: ERROR: syntax
error at or near "ANDALTER" at character 521.

>
> Regards,
> Andresa
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2005-10-04 18:48:12 Re: Pgadmin-1.2.2 Support request
Previous Message Andreas Pflug 2005-10-04 17:33:06 Re: bigserial problem