Re: bigserial problem - Mailing list pgadmin-support
From | rich.morrison@atxinc.com |
---|---|
Subject | Re: bigserial problem |
Date | |
Msg-id | OFDBC13D78.AA34D548-ON85257090.0061A44F-85257090.0062432D@atxforms.com Whole thread Raw |
In response to | Re: bigserial problem (Andreas Pflug <pgadmin@pse-consulting.de>) |
Responses |
Re: bigserial problem
|
List | pgadmin-support |
<br /><font face="sans-serif" size="2"><br /> Thank you,<br /><br /> Richard Morrison<br /> Sr. Software Engineer<br /> ATXII, LLC<br /> "In Rich We Trust!"</font><br /><br /><font size="2"><tt>pgadmin-support-owner@postgresql.org wrote on 10/04/200501:33:06 PM:<br /><br /> > rich.morrison@atxinc.com wrote:<br /> > > <br /> > > pgAdmin reportsa SQL error when attempting to add a bigserial column to <br /> > > an existing table.<br /> > <br /> >I checked this, it works.<br /></tt></font><br /><font size="2"><tt>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 installedwith the msi installer.</tt></font><br /><br /><font size="2"><tt>> <br /> > > <br /> > > Addingthe column produces this SQL statement:<br /> > > <br /> > > CREATE SEQUENCE public.tblenglish_in_trnas_id_seq;<br/> > > ALTER TABLE tblenglish_in<br /> > > ADD COLUMN trnas_id int8;<br/> > > ALTER TABLE tblenglish_in<br /> > > ALTER COLUMN trnas_id SET DEFAULT <br /> > > nextval('public.tblenglish_in_trnas_id_seq'::text);<br/> > > INSERT INTO pg_depend(classid, objid, objsubid, refclassid,refobjid, <br /> > > refobjsubid, deptype)<br /> > > SELECT cl.oid, seq.oid, 0, cl.oid, 17154::oid,attnum, 'i'<br /> > > FROM pg_class cl, pg_attribute, pg_class seq<br /> > > JOIN pg_namespacesn ON sn.OID=seq.relnamespace<br /> > > WHERE cl.relname='pg_class'<br /> > > AND seq.rel<br />> <br /> > Not quite. The resulting sql query can be taken from the SQL page of the <br /> > dialog. What youpresent here is probably what's logged in pgadmin.log, <br /> > which might get truncated to 1k (AFAIR) for technicalreasons.<br /></tt></font><br /><font face="sans-serif" size="2">Nope. I copied the statement from the SQL tab fromthe properties dialog of a table I created earlier.</font><br /><br /><font size="2"><tt>I copied this one from the samedialog as well:</tt></font><br /><br /><font size="2"><tt>CREATE SEQUENCE public.tbltest_s_seq;</tt></font><br /><fontsize="2"><tt>ALTER TABLE tbltest</tt></font><br /><font size="2"><tt> ADD COLUMN s int8;</tt></font><br /><fontsize="2"><tt>ALTER TABLE tbltest</tt></font><br /><font size="2"><tt> ALTER COLUMN s SET DEFAULT nextval('public.tbltest_s_seq'::text);</tt></font><br/><font size="2"><tt>INSERT INTO pg_depend(classid, objid, objsubid,refclassid, refobjid, refobjsubid, deptype)</tt></font><br /><font size="2"><tt>SELECT cl.oid, seq.oid, 0, cl.oid,17474::oid, attnum, 'i'</tt></font><br /><font size="2"><tt> FROM pg_class cl, pg_attribute, pg_class seq</tt></font><br/><font size="2"><tt> JOIN pg_namespace sn ON sn.OID=seq.relnamespace</tt></font><br /><font size="2"><tt> WHEREcl.relname='pg_class'</tt></font><br /><font size="2"><tt> AND seq.relname='tbltest_s_seq'</tt></font><br/><font size="2"><tt> AND sn.nspname='public'</tt></font><br /><font size="2"><tt> ANDALTER TABLE tbltest</tt></font><br /><font size="2"><tt> ADD COLUMN test varchar(30);</tt></font><br /><br/><font size="2"><tt>Notice the 'ANDALTER'? Part of the previous query is definately missing.</tt></font><br /><br /><fontsize="2"><tt>Clicking ok on the dialog gives the error: ERROR: syntax error at or near "ANDALTER" at character 509.</tt></font><br/><br /><font size="2"><tt>Running the SQL statement in the SQL window gives the error: ERROR: syntaxerror at or near "ANDALTER" at character 521.</tt></font><br /><br /><br /><br /><font size="2"><tt>> <br /> >Regards,<br /> > Andresa<br /> > <br /> > ---------------------------(end of broadcast)---------------------------<br/> > TIP 9: In versions below 8.0, the planner will ignore your desire to<br />> choose an index scan if your joining column's datatypes do not<br /> > match<br /></tt></font>
pgadmin-support by date: