Re: Redundant statements

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Erwin Brandstetter <brandstetter(at)falter(dot)at>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Redundant statements
Date: 2010-04-29 13:21:13
Message-ID: 4BD987C9.3060200@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Sorry for not answering sooner.

Le 29/04/2010 14:15, Erwin Brandstetter a écrit :
> On 28.04.2010 19:16, brandstetter(at)falter(dot)at wrote:
>> Aloha!
>>
>> I am testing Guillaume's version of pgadmin3.exe from Apr. 17.
>>
>> The fix below is included and it seems to fix the problem just fine.
>> However, as a side effect (?) there is now a redundant statement for
>> each and every column:
>> ALTER TABLE foo ALTER COLUMN bar SET STORAGE PLAIN;
>> or
>> ALTER TABLE foo ALTER COLUMN baz SET STORAGE EXTENDED;
>>
>> I think those statements should only be included, if the storage type
>> differs from the default setting - like "SET STATISTICS" is handled now.
>> It is pretty noisy as it is now.

"SET STATISTICS" is not really handled this way. We had "SET STATISTICS"
statement if the value is bigger than zero. (Because if it is zero,
PostgreSQL will use the default_statistics_target setting.

Anyway, I agree that "SET STORAGE" is really noisy. Suppose a table with
20 columns. You will have 20 statements about storage. I agree that
something like this is needed. My problem is: what should we use as a
default value? PLAIN would be the default on non-toastable columns, and
EXTENDED the one to use with toastable columns? is there a way to be
sure of this?

>> On a side note: I would handle "WITH (OIDS=FALSE)" for table
>> definitions likewise: only print it, if it differs from the default
>> setting.

If we do this, a user won't be able to copy the SQL and paste/execute it
on another server if this one has another value for default_with_oids.
So, I'm against its removal (unless someone could prove I'm wrong :) ).

> Maybe an option "Show complete SQL"? To switch between "complete"
> (noisy) and default display (only what is necessary to create an
> identical object with the current settings).
> Personally I am only interested in the "compact" version, but other
> people's preferences may vary?

I'm not sure about this either. How could a user know about the
differences between a complete and a partial SQL?

> This would be a major wishlist item. Not complicated, but possibly many
> lines of code.

Well, actually, the only thing I think is needed here is to display (or
not) some column's properties. Not complicated, not a lot of code.

> What do you think of it? Should I create a ticket?

Well, I would like to have a better handling of the "SET STORAGE"
statement. So, yes, you can create a ticket on that, without being too
specific on the solution, which still needs some talk.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2010-04-29 13:25:07 Re: PATCH(WIP): Printing Support And Save GQB/Explain as an image
Previous Message Erwin Brandstetter 2010-04-29 12:15:44 Re: Redundant statements