I found a few notices and warnings that inform you that the command you
are executing has no effect because the object is already in the state you
want it.  I think these are useless, and there is also some inconsistency.
Does someone want to defend keeping them?

=> alter table test set without oids;
NOTICE:  table "test" is already WITHOUT OIDS

=> alter table test cluster on test_ix;
NOTICE:  table "test" is already being clustered on index "test_ix"

=> alter domain foo set not null;
NOTICE:  "foo" is already set to NOT NULL
[no such notice for altering a column, btw.]

=> listen foo;
WARNING:  already listening on "foo"

=> alter group test add user peter;
WARNING:  user "peter" is already in group "test"
[The SQL analogue with roles does not call for a completion condition in
this case.]

-- 
Peter Eisentraut   peter_e@gmx.net


Sat, 6 Sep 2003 00:47:21 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Notices for redundant operations
On Sat, Sep 06, 2003 at 12:47:21AM +0200, Peter Eisentraut wrote:
> I found a few notices and warnings that inform you that the command you
> are executing has no effect because the object is already in the state you
> want it.  I think these are useless, and there is also some inconsistency.
> Does someone want to defend keeping them?

If people doesn't receive any message regarding the command they
executed, they will execute it again, and again, and they will
eventually wonder what's wrong and start investigating why "nothing is
happening".

Warnings should be converted to notices, IMHO.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The problem with the future is that it keeps turning into the present"
(Hobbes)

Fri, 5 Sep 2003 19:10:18 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: Notices for redundant operations
Peter Eisentraut <peter_e@gmx.net> writes:
> I found a few notices and warnings that inform you that the command you
> are executing has no effect because the object is already in the state you
> want it.  I think these are useless, and there is also some inconsistency.
> Does someone want to defend keeping them?

Do you think the commands should just silently do nothing?  That seems
strange to me.  I like giving a NOTICE (not WARNING though, those guys
should be changed).

I guess the best argument for putting out a notice is that there's some
chance the user is making a mistake, eg, telling you SET NOT NULL when
what he really wanted to do was DROP NOT NULL.  If that argument doesn't
impress people then I suppose being silent is the thing to do.

			regards, tom lane

Fri, 05 Sep 2003 19:55:44 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Notices for redundant operations 
Alvaro Herrera writes:

> If people doesn't receive any message regarding the command they
> executed, they will execute it again, and again, and they will
> eventually wonder what's wrong and start investigating why "nothing is
> happening".

That is not the case here.  The commands still generate the normal
response, e.g., "ALTER TABLE", if they succeed.

-- 
Peter Eisentraut   peter_e@gmx.net


Sat, 6 Sep 2003 13:25:18 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Notices for redundant operations
"Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > I found a few notices and warnings that inform you that the command you
> > are executing has no effect because the object is already in the state
you
> > want it.  I think these are useless, and there is also some
inconsistency.
> > Does someone want to defend keeping them?
>
> Do you think the commands should just silently do nothing?  That seems
> strange to me.  I like giving a NOTICE (not WARNING though, those guys
> should be changed).

Of course not but I personally prefer have back a normal response.

Regards
Gaetano Mendola




Sat, 6 Sep 2003 15:46:33 +0200
"Mendola Gaetano" <mendola@bigfoot.com>
Re: Notices for redundant operations
On Saturday 06 September 2003 07:25, Peter Eisentraut wrote:
> Alvaro Herrera writes:
> > If people doesn't receive any message regarding the command they
> > executed, they will execute it again, and again, and they will
> > eventually wonder what's wrong and start investigating why "nothing is
> > happening".
>
> That is not the case here.  The commands still generate the normal
> response, e.g., "ALTER TABLE", if they succeed.

Hmm... the counter state seems to be that now these commands would tell you 
they are doing something even though they are arn't really doing anything:

=> alter table test set without oids;
ALTER TABLE
=> alter table test set without oids;
ALTER TABLE
=> alter table test set without oids;
ALTER TABLE

I think popping a notice that the table is already without oids could be 
helpful. for sure these types of messages should not be warnings though.

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

Sat, 6 Sep 2003 10:41:47 -0400
Robert Treat <xzilla@users.sourceforge.net>
Re: Notices for redundant operations
Robert Treat writes:

> Hmm... the counter state seems to be that now these commands would tell you
> they are doing something even though they are arn't really doing anything:

Commands are defined in terms of their results, not in terms of their
actions, and certainly not in terms of the amount of grinding that is
caused by them.

Have you ever realized that

GRANT SELECT ON table1 TO person;

might not do anything?  No one has suggested notices for that.  Or have
you ever seen a notice issued as the result of

chmod a+x filename

when the file was already executable?

-- 
Peter Eisentraut   peter_e@gmx.net


Sun, 7 Sep 2003 18:36:47 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Notices for redundant operations
On Sun, Sep 07, 2003 at 06:36:47PM +0200, Peter Eisentraut wrote:
> Robert Treat writes:
> 
> > Hmm... the counter state seems to be that now these commands would tell you
> > they are doing something even though they are arn't really doing anything:
> 
> Commands are defined in terms of their results, not in terms of their
> actions, and certainly not in terms of the amount of grinding that is
> caused by them.

This argument makes sense.  At least it convinced me.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La fuerza no estï¿½ en los medios fï¿½sicos
sino que reside en una voluntad indomable" (Gandhi)

Sun, 7 Sep 2003 16:20:40 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: Notices for redundant operations
I wrote:

> I found a few notices and warnings that inform you that the command you
> are executing has no effect because the object is already in the state you
> want it.  I think these are useless, and there is also some inconsistency.
> Does someone want to defend keeping them?

I take it that people have grown to agree that these notices aren't really
useful.  So this is the last call before they'll disappear.

-- 
Peter Eisentraut   peter_e@gmx.net


Wed, 10 Sep 2003 20:19:52 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Notices for redundant operations