Earlier I had argued that SET LOCAL should not be used in the context it
is now, and I had suggested SET TRANSACTION as a replacement.  However,
now that I look at it in the implementation, this syntax is just too
bizzare and prone to confuse.

Here are a couple of examples of what is/would be possible.

SET SESSION SESSION AUTHORIZATION

(This is semantically valid, since the parameter is the "session
authorization" and you want it to last for the session.)

SET TRANSACTION SESSION AUTHORIZATION

(Clearly confusing)

SET SESSION TRANSACTION ISOLATION LEVEL

(Syntactically valid, but nonsensical.)

SET TRANSACTION TRANSACTION ISOLATION LEVEL

(Stupid)

SET TRANSACTION ISOLATION LEVEL

(This seems to imply that the parameter name is "isolation level" whereas
in fact the "transaction" belongs to the parameter name.)

SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL
SET TRANSACTION SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL

(OK, you get the idea...)

As an alternative syntax I can suggest

SET name TO value [ ON COMMIT RESET ];

I think this is painfully clear, is similar to other SQL standard
commands, and draws on existing terminology (COMMIT/RESET).  OK, slightly
more typing, I guess.

Comments?

-- 
Peter Eisentraut   peter_e@gmx.net


Thu, 25 Jul 2002 22:55:21 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
SET LOCAL again
Peter Eisentraut <peter_e@gmx.net> writes:
> As an alternative syntax I can suggest

> SET name TO value [ ON COMMIT RESET ];

Ugh.  Why can't we stick with SET LOCAL?

			regards, tom lane

Fri, 26 Jul 2002 11:09:29 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: SET LOCAL again 
Tom Lane writes:

> > As an alternative syntax I can suggest
>
> > SET name TO value [ ON COMMIT RESET ];
>
> Ugh.  Why can't we stick with SET LOCAL?

SET LOCAL is already used for something else in the SQL standard.  Not
sure if we'll ever implement that, but it's something to be concerned
about.

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 30 Jul 2002 18:38:28 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: SET LOCAL again 
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
> As an alternative syntax I can suggest
>> 
> SET name TO value [ ON COMMIT RESET ];
>> 
>> Ugh.  Why can't we stick with SET LOCAL?

> SET LOCAL is already used for something else in the SQL standard.  Not
> sure if we'll ever implement that, but it's something to be concerned
> about.

Actually, it looks to me like the spec's SET LOCAL has a compatible
interpretation: it only affects the current transaction.

My main gripe with "ON COMMIT RESET" is that it's a misleading
description of what will happen --- RESETting a variable is quite
different from allowing it to revert to the pre-transaction state.

			regards, tom lane

Tue, 30 Jul 2002 12:44:57 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: SET LOCAL again 
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Tom Lane writes:
> > As an alternative syntax I can suggest
> >> 
> > SET name TO value [ ON COMMIT RESET ];
> >> 
> >> Ugh.  Why can't we stick with SET LOCAL?
> 
> > SET LOCAL is already used for something else in the SQL standard.  Not
> > sure if we'll ever implement that, but it's something to be concerned
> > about.
> 
> Actually, it looks to me like the spec's SET LOCAL has a compatible
> interpretation: it only affects the current transaction.
> 
> My main gripe with "ON COMMIT RESET" is that it's a misleading
> description of what will happen --- RESETting a variable is quite
> different from allowing it to revert to the pre-transaction state.

I don't like stuff trailing off at the end, especially three words. 
That SET command is getting so big, it may fall over.  ;-)

-- 
  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

Tue, 30 Jul 2002 12:47:46 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: SET LOCAL again






Bruce Momjian wrote:

Tom Lane wrote:
  

Peter Eisentraut <peter_e@gmx.net> writes:
    

Tom Lane writes:
As an alternative syntax I can suggest
      
SET name TO value [ ON COMMIT RESET ];
      

Ugh.  Why can't we stick with SET LOCAL?
        



SET LOCAL is already used for something else in the SQL standard.  Not
sure if we'll ever implement that, but it's something to be concerned
about.
      

Actually, it looks to me like the spec's SET LOCAL has a compatible
interpretation: it only affects the current transaction.

My main gripe with "ON COMMIT RESET" is that it's a misleading
description of what will happen --- RESETting a variable is quite
different from allowing it to revert to the pre-transaction state.
    


I don't like stuff trailing off at the end, especially three words. 
That SET command is getting so big, it may fall over.  ;-)

  

Perhaps ON COMMIT REVERT would be more intuitive.



Tue, 30 Jul 2002 16:48:40 -0500
Thomas Swan <tswan@idigx.com>
Re: SET LOCAL again