[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-general
Subject: Re: [HACKERS] SESSION SESSION - bug or intentional?
From: "David G. Johnston" <david.g.johnston () gmail ! com>
Date: 2015-09-30 22:08:54
Message-ID: CAKFQuwZALLTuwXg23Pd34vvcd+4o7f6MWPAFt+zfMbUnHwAVtg () mail ! gmail ! com
[Download RAW message or body]
On Wed, Sep 30, 2015 at 5:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > On Wed, Sep 30, 2015 at 2:52 PM, Joe Conway <mail@joeconway.com> wrote:
> >> I was looking at something in gram.y when I noticed that the following
> >> production works:
> >> SET SESSION SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
> >> "SESSION SESSION" seems fairly odd -- is it intentional?
>
> > However, SET SESSION AUTHORIZATION is defined as thus:
> > SET [ SESSION | LOCAL ] SESSION AUTHORIZATION user_name
>
> Yeah. SET LOCAL SESSION AUTHORIZATION is valid and useful. The optional
> SESSION is just a noise word here, but disallowing it would be
> non-orthogonal compared to other similar syntaxes.
>
While I get the gist of what you are saying the phrase:
"[...] but disallowing it would be non-orthogonal compared to other similar
syntaxes."
doesn't compute for me. You mind trying that again?
I take it that means that disallowing it would be "inconsistent" given
what we allow in similar commands.
Given that conclusion shouldn't the following be modified?
http://www.postgresql.org/docs/devel/static/sql-set-transaction.html
SET [ SESSION | LOCAL ] SESSION CHARACTERISTICS AS TRANSACTION
transaction_mode [, ...]
Both are allowed though the one is redundant and the other (presumably)
ignored, repsectively.
A code comment in the grammar would be warranted at the least - not going
there myself.
I haven't tried to figure out what exactly LOCAL results in if specified
vis-a-vis the presence of absence of an active transcation.
David J.
[Attachment #3 (text/html)]
<div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><span \
style="font-family:arial,sans-serif">On Wed, Sep 30, 2015 at 5:49 PM, Tom Lane \
</span><span dir="ltr" style="font-family:arial,sans-serif"><<a \
href="mailto:tgl@sss.pgh.pa.us" target="_blank">tgl@sss.pgh.pa.us</a>></span><span \
style="font-family:arial,sans-serif"> wrote:</span><br></div><div \
class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span \
class="">"David G. Johnston" <<a \
href="mailto:david.g.johnston@gmail.com">david.g.johnston@gmail.com</a>> \
writes:<br> > On Wed, Sep 30, 2015 at 2:52 PM, Joe Conway <<a \
href="mailto:mail@joeconway.com">mail@joeconway.com</a>> wrote:<br> >> I was \
looking at something in gram.y when I noticed that the following<br> >> \
production works:<br> >> SET SESSION SESSION CHARACTERISTICS AS TRANSACTION \
READ ONLY;<br> >> "SESSION SESSION" seems fairly odd -- is it \
intentional?<br> <br>
</span><span class="">> However, SET SESSION AUTHORIZATION is defined as thus:<br>
> SET [ SESSION | LOCAL ] SESSION AUTHORIZATION user_name<br>
<br>
</span>Yeah. SET LOCAL SESSION AUTHORIZATION is valid and useful. The \
optional<br> SESSION is just a noise word here, but disallowing it would be<br>
non-orthogonal compared to other similar \
syntaxes.<br></blockquote><div><br></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline">While I get the gist \
of what you are saying the phrase:</div></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline">"[...] but \
disallowing it would be non-orthogonal compared to other similar \
syntaxes."</div></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline">doesn't compute for \
me. You mind trying that again?</div></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">I take it \
that means that disallowing it would be "inconsistent" given what we allow \
in similar commands.</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Given that conclusion shouldn't \
the following be modified?<br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><a \
href="http://www.postgresql.org/docs/devel/static/sql-set-transaction.html">http://www.postgresql.org/docs/devel/static/sql-set-transaction.html</a><br></div><div \
class="gmail_default" style=""><font face="arial, helvetica, sans-serif">SET [ \
SESSION | LOCAL ] SESSION CHARACTERISTICS AS TRANSACTION transaction_mode [, \
...]</font><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div></div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">Both are allowed \
though the one is redundant and the other (presumably) ignored, \
repsectively.</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">A code comment in the grammar would be \
warranted at the least - not going there myself.</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">I haven't tried to figure out what \
exactly LOCAL results in if specified vis-a-vis the presence of absence of an active \
transcation.</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline">David \
J.</div></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div></div></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic