Обсуждение: Requirement for pgAdmin browser.

Поиск
Список
Период
Сортировка

Requirement for pgAdmin browser.

От
Anil Jangam
Дата:
Hi Dave,

It is observed that while creating table, once we define the attributes and
their properties, we can not change the attribute type. e.g. If we have
defined an attribute of type int. Now if one want to change it to numeric,
it is not allowed thorugh the pgAdmin GUI. However we have the option of
further addition of the attribute to the table. Also it is not possible to
remove the present attribute(s) in the table.

Is this a valid to have this kind of restriction if one want to do similar
change?? I think either we have to go to the psql prompt and use some
command, or refine the whole table after dropping the old one.

Is there any solution to this through GUI, as it is easy to do it.

-anil.



Re: Requirement for pgAdmin browser.

От
Dave Page
Дата:

> -----Original Message-----
> From: Anil Jangam [mailto:anilj@indts.com]
> Sent: 14 December 2001 13:04
> To: 'Dave Page'; 'pgsql-cygwin@postgresql.org'
> Subject: Requirement for pgAdmin browser.
> Importance: High
>
>
> Hi Dave,
>
> It is observed that while creating table, once we define the
> attributes and their properties, we can not change the
> attribute type. e.g. If we have defined an attribute of type
> int. Now if one want to change it to numeric, it is not
> allowed thorugh the pgAdmin GUI. However we have the option
> of further addition of the attribute to the table. Also it is
> not possible to remove the present attribute(s) in the table.

No, this is a limitation of PostgreSQL, *not* pgAdmin. As soon as PostgreSQL
allows ALTER COLUMN and DROP COLUMN I will ensure that pgAdmin does as well.

> Is this a valid to have this kind of restriction if one want
> to do similar change?? I think either we have to go to the
> psql prompt and use some command, or refine the whole table
> after dropping the old one.
>
> Is there any solution to this through GUI, as it is easy to do it.

No, it's not easy to do, it's incredibly difficult. The only easy ways of
doing it is to do a SELECT INTO, or hand edit a pg_dump file, then reload
it. The problem with the SELECT INTO method is that you will lose any
comments, checks, indexes, constraints, foreign keys or triggers defined on
the table, and any objects that use the table's tuple structure as a type
will also be affected. SQL Functions that access the table may also be
affected, although PL/* functions should be OK.

If you need to drop or alter a column, I would suggest the pg_dump method,
unless you know that SELECT INTO will work for you.

Regards, Dave.

Re: Requirement for pgAdmin browser.

От
Jean-Michel POURE
Дата:
> No, it's not easy to do, it's incredibly difficult.
It is pretty useless as these pseudo-features will not survive after
PotsgreSQL get ***fixed***. So why invest development time to add
features that should be added by core developpers server-side?

/JMP

Re: Requirement for pgAdmin browser.

От
Jean-Michel POURE
Дата:
Le Vendredi 14 Décembre 2001 14:04, vous avez écrit :
> It is observed that while creating table, once we define the attributes and
> their properties, we can not change the attribute type. e.g. If we have
> defined an attribute of type int. Now if one want to change it to numeric,
> it is not allowed thorugh the pgAdmin GUI. However we have the option of
> further addition of the attribute to the table. Also it is not possible to
> remove the present attribute(s) in the table.

PostgreSQL does not allow table modification. The community have been waiting
for an ALTER TABLE DROP COLUMN and type PROMOTION / DEMOTION, for a long
time. Same as for Views and triggers : it is impossible to alter them... The
politics of PostgreSQL is to offer advanced features before basic ones.

Is anyone working seriously on those issues?

>> Is this a valid to have this kind of restriction if one want to do similar
> change?? I think either we have to go to the psql prompt and use some
> command, or refine the whole table after dropping the old one.
> Is there any solution to this through GUI, as it is easy to do it.

The only workaround by now is to use CREATE TABLE AS and dropping the old
table.

In pgAdmin I, we used to offer a development mode where you could modify all
parameters. Then the changes were applied to the database in a pseudo
compilation (drop/create). Then, we decided to wait for real ALTER features
in PostgreSQL. We are still waiting for them.

Best regards
Jean-Michel POURE

Re: [HACKERS] Requirement for pgAdmin browser.

От
Bruce Momjian
Дата:
> Le Vendredi 14 D?cembre 2001 14:04, vous avez ?crit :
> > It is observed that while creating table, once we define the attributes and
> > their properties, we can not change the attribute type. e.g. If we have
> > defined an attribute of type int. Now if one want to change it to numeric,
> > it is not allowed thorugh the pgAdmin GUI. However we have the option of
> > further addition of the attribute to the table. Also it is not possible to
> > remove the present attribute(s) in the table.
>
> PostgreSQL does not allow table modification. The community have been waiting
> for an ALTER TABLE DROP COLUMN and type PROMOTION / DEMOTION, for a long
> time. Same as for Views and triggers : it is impossible to alter them... The
> politics of PostgreSQL is to offer advanced features before basic ones.
>
> Is anyone working seriously on those issues?

Agreed.  We couldn't decide the best way to do it, so we did nothing.  I
have hopes for 7.3.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026