Обсуждение: pgAdmin3: adding comments to existing tables

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

pgAdmin3: adding comments to existing tables

От
Terence Kearns
Дата:
because the interface attempts to "re-submit all" of the properties of 
the existing table for alteration, if you want to change any one 
property of a table, you need to re-apply all properties. This has the 
undesired side-effect of failing *any* modification to a table if any of 
the other *existing* properties fail to qualify for re-applying through 
ALTERing.

For instance, I have a table containing a column with a default value.

When I try to use pgAdmin3 to add(modify) a(the) comment to that table, 
the operation fails with the message.

ERROR: Adding columns with defaults is not implementd...

This is silly bacause my intent was not to add a column. I think this 
may be a user-interface design limitation.

-- 
Terence Kearns ~ ph: +61 2 6201 5516
IT Database/Applications Developer
Enterprise Information Systems
Client Services Division
University of Canberra
www.canberra.edu.au



Re: pgAdmin3: adding comments to existing tables

От
Andreas Pflug
Дата:
Terence Kearns wrote:

> because the interface attempts to "re-submit all" of the properties of 
> the existing table for alteration, 

That should not happen at all. There's a lot of effort taken to identify 
only changes, and submit only these changes.

> if you want to change any one property of a table, you need to 
> re-apply all properties. This has the undesired side-effect of failing 
> *any* modification to a table if any of the other *existing* 
> properties fail to qualify for re-applying through ALTERing.
>
> For instance, I have a table containing a column with a default value.
>
> When I try to use pgAdmin3 to add(modify) a(the) comment to that 
> table, the operation fails with the message.
>
> ERROR: Adding columns with defaults is not implementd...
>
> This is silly bacause my intent was not to add a column. I think this 
> may be a user-interface design limitation. 

Please state exactly what you are doing, because what you're describing 
here shouldn't happen at all.

Regards,
Andreas



Re: pgAdmin3: adding comments to existing tables

От
Terence Kearns
Дата:
Andreas Pflug wrote:
> Terence Kearns wrote:
> 
>> because the interface attempts to "re-submit all" of the properties of 
>> the existing table for alteration, 
> 
> 
> That should not happen at all. There's a lot of effort taken to identify 
> only changes, and submit only these changes.
> 

Oh ok. my mistake. I assumed that after the following:

Using pgAdmin3, I create a table which now looks like...
CREATE TABLE global.users
(  "userCode" varchar(16),  "userId" int4 NOT NULL DEFAULT nextval('seq_userIds'::text),  fname varchar(32) NOT NULL,
lnamevarchar(32),  email varchar(256),  mobile varchar(32),  phone varchar(32),  "orgId" int4,  "selfGroup" int4 NOT
NULL, CONSTRAINT pk_users PRIMARY KEY ("userId"),  CONSTRAINT "unique_userCode" UNIQUE ("userCode")
 
) WITHOUT OIDS;


Then I select the properties panel in pgAdmin3 for this table and enter 
some text in the comment field which is now blank. As a result, I get 
the following error:

ERROR: Adding columns with defaults is not implemented.Add the column, then use ALTER TABLE SET DEFAULT


After doing some more work on another table to fix it, I have another 
theory, this table is broken because the function call used as the 
DEFAULT value for userId will fail. (I've just learned that not keeping 
everything lower-case in postgres tends to "break things" - despite all 
the double quotes used).


-- 
Terence Kearns ~ ph: +61 2 6201 5516
IT Database/Applications Developer
Enterprise Information Systems
Client Services Division
University of Canberra
www.canberra.edu.au