Home > Archive > Pgadmin > May 2005 > Alter columntype with pgadmin?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Alter columntype with pgadmin?
Walter Haslbeck

2005-05-27, 3:24 am

Hi,

now that PostgreSQL 8 supports changing the datatype of a column with
the 'ALTER TABLE ... ALTER COLUMN ... TYPE new_type [USING ...]' syntax
it would be great if pgadminIII has an option to do this via GUI.

Are there any efforts to support this feature in pgadminIII?

Walter

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)

Dave Page

2005-05-27, 3:24 am



> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of
> Walter Haslbeck
> Sent: 27 May 2005 09:12
> To: pgadmin-support@postgresql.org
> Subject: [pgadmin-support] Alter columntype with pgadmin?
>
> Hi,
>
> now that PostgreSQL 8 supports changing the datatype of a column with
> the 'ALTER TABLE ... ALTER COLUMN ... TYPE new_type [USING
> ...]' syntax
> it would be great if pgadminIII has an option to do this via GUI.
>
> Are there any efforts to support this feature in pgadminIII?


pgAdmin does support this feature in the 1.3 development series, but I'm
pretty sure it was in 1.2 as well.

Regards, Dave

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org

Vincent CARON

2005-05-27, 3:24 am

on 27/05/2005 10:11 Walter Haslbeck said the following:
> Hi,
>
> now that PostgreSQL 8 supports changing the datatype of a column with
> the 'ALTER TABLE ... ALTER COLUMN ... TYPE new_type [USING ...]' syntax
> it would be great if pgadminIII has an option to do this via GUI.
>
> Are there any efforts to support this feature in pgadminIII?
>
> Walter
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)
>

Very good idea!

--

GPG Key: http://covoiturage.fr/caron.asc

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Walter Haslbeck

2005-05-27, 7:23 am

Hi,

> pgAdmin does support this feature in the 1.3 development series, but I'm
> pretty sure it was in 1.2 as well.


Well, I'm using the latest binary snapshot of the win32-version
(20050526) and can't find this feature. If I open the propertys for a
column of e.g. type 'char', the datatype and size input-boxes are greyed
out. Where can I e.g. change the length of the char from 20 to 30?

Walter


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)

Dave Page

2005-05-27, 7:24 am



> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of
> Walter Haslbeck
> Sent: 27 May 2005 10:48
> Cc: pgadmin-support@postgresql.org
> Subject: Re: [pgadmin-support] Alter columntype with pgadmin?
>
> Hi,
>
> series, but I'm
>
> Well, I'm using the latest binary snapshot of the win32-version
> (20050526) and can't find this feature. If I open the propertys for a
> column of e.g. type 'char', the datatype and size input-boxes
> are greyed
> out. Where can I e.g. change the length of the char from 20 to 30?


If there is a suitable cast in the database, then the combo box will be
populated with usable column types and made selectable (try it with
varchar which should be castable). Any other conversion requires the use
of the USING clause to the alter table statement which pgAdmin doesn't
support. Also, from a quick scan of the code it appears that it won't
let you try to change the types of columns referenced in foreign keys.

Regards, Dave.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Walter Haslbeck

2005-05-27, 7:24 am

Hi,

> If there is a suitable cast in the database, then the combo box will be
> populated with usable column types and made selectable (try it with
> varchar which should be castable). Any other conversion requires the use
> of the USING clause to the alter table statement which pgAdmin doesn't
> support. Also, from a quick scan of the code it appears that it won't


OK, I see that a conversion that needs a USING clause is hard to handle
with the GUI. But changing the size of a char doesn't need USING:

CREATE TABLE t1 ( c1 char(20) );
ALTER TABLE t1 ALTER column c1 TYPE char(30);
ALTER TABLE t1 ALTER column c1 TYPE char(10);

Its also possible (e.g.) to change from CHAR() to INT, (but not vice
versa) etc. without the USING clause. It would be great if I can do such
clear conversions with pgadminIII.

> let you try to change the types of columns referenced in foreign keys.


yes, of course, but perhaps you can implement a 'alter type cascade'
option. (OK, priority -999 :) )

Walter




---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com