Unix Technical Forum

wrong generated sql query order

This is a discussion on wrong generated sql query order within the pgsql Interfaces Pgadmin Support forums, part of the PostgreSQL category; --> hi! i had opened the table properties window and on the "columns" tab removed a column and immediately added ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 08:07 PM
Miha Radej
 
Posts: n/a
Default wrong generated sql query order

hi!

i had opened the table properties window and on the "columns" tab
removed a column and immediately added a new one with the same name only
of different type. this change failed due to a wrong sql query order;
pgadmin had produced this
ALTER TABLE document_data ADD COLUMN locked_by text;
ALTER TABLE document_data DROP COLUMN locked_by;
instead of
ALTER TABLE document_data DROP COLUMN locked_by;
ALTER TABLE document_data ADD COLUMN locked_by text;

i am using pgadmin3 version 1.2.2 (jun 22 2005), installed from a rpm
package provided by vasilev max. i am using suse linux 9.3 and am unable
to build my own binaries on this machine so i cannot verify if this
occurs on any other versions of pgadmin3.

i apologize if this is old news but i didnt find anything similair in
the mailing list archives after a quick search.

cheers,
M

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 08:07 PM
Vasilev Max
 
Posts: n/a
Default Re: wrong generated sql query order

Miha Radej wrote:
> hi!
>
> i had opened the table properties window and on the "columns" tab
> removed a column and immediately added a new one with the same name
> only of different type. this change failed due to a wrong sql query
> order; pgadmin had produced this
> ALTER TABLE document_data ADD COLUMN locked_by text;
> ALTER TABLE document_data DROP COLUMN locked_by;
> instead of
> ALTER TABLE document_data DROP COLUMN locked_by;
> ALTER TABLE document_data ADD COLUMN locked_by text;
>
> i am using pgadmin3 version 1.2.2 (jun 22 2005), installed from a rpm
> package provided by vasilev max. i am using suse linux 9.3 and am
> unable to build my own binaries on this machine so i cannot verify if
> this occurs on any other versions of pgadmin3.
>
> i apologize if this is old news but i didnt find anything similair in
> the mailing list archives after a quick search.
>
> cheers,
> M
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

Hi!

Unfortunately, I can not confirm this bug. Please, show me full
structure of your table.

wbr,
Vasilev Max
pgadmin3 1.2.2 (22.06.2005)
SuSE Linux 9.3 Professional x86/x86_64


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 08:07 PM
Miha Radej
 
Posts: n/a
Default Re: wrong generated sql query order

hi!

this happens to me on any table i've tried. here is a sample:

CREATE TABLE sampletable
(
col1 serial NOT NULL,
col2 int4
)
WITH OIDS;
ALTER TABLE sampletable OWNER TO adocuments;

this is a table in a "adocuments" schema, owned by the user "adocuments".

in the table properties pane, tab "columns" i then remove col2 and
immediately add another column, by the name of col2 and type text and
pgadmin produces the following queries:

ALTER TABLE sampletable ADD COLUMN col2 text;
ALTER TABLE sampletable DROP COLUMN col2;

i cannot at this time test this with any other version of pgadmin3 or on
any other system.

btw, thank you for having provided a suse rpm, it helps immensely as i
am atm not in position to compile it on my own

cheers,
Miha

Vasilev Max wrote:
> Hi!
>
> Unfortunately, I can not confirm this bug. Please, show me full
> structure of your table.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 08:07 PM
Andreas Pflug
 
Posts: n/a
Default Re: wrong generated sql query order

Miha Radej wrote:

>
> in the table properties pane, tab "columns" i then remove col2 and
> immediately add another column, by the name of col2 and type text and
> pgadmin produces the following queries:
>
> ALTER TABLE sampletable ADD COLUMN col2 text;
> ALTER TABLE sampletable DROP COLUMN col2;


This is a known issue. Don't do this ATM.

Regards,
Andreas


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com