Re: Documentation for SET var_name FROM CURRENT

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Documentation for SET var_name FROM CURRENT
Date: 2013-10-01 14:16:43
Message-ID: CAA4eK1+r9XctN0vWys037f+u=kXP3L8-jg-hjoezEUV2hOJhRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 1, 2013 at 6:27 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:
> Amit Kapila-2 wrote
>> On Tue, Oct 1, 2013 at 10:25 AM, David Johnston <
>
>> polobo@
>
>> > wrote:
>>> Amit Kapila-2 wrote
>>>> While reading documentation for SET command, I observed that FROM
>>>> CURRENT syntax and its description is missing from SET command's
>>>> syntax page (http://www.postgresql.org/docs/devel/static/sql-set.html).
>>>>
>>>> Do you think that documentation should be updated for the same or is
>>>> there any reason why it is not documented?
>>>
>>> It is documented as part of "CREATE FUNCTION" since its use is only valid
>>> in
>>> that context.
>>
>> Not only as part of "CREATE FUNCTION", but as part of "ALTER
>> DATABASE", "ALTER ROLE", "ALTER FUNCTION" syntax as well. In all these
>> places other syntax of "SET" is also used and described.
>> I think you are right that syntax
>> <SET .. FROM CURRENT>
>> is mainly used
>> in context with few other SQL statements, but as it is part of SET
>> command, so isn't it better to mention the syntax on SET page and may
>> be explain a bit about its usage?
>>
>>> The paragraph with the link to CREATE FUNCTION seems
>>> sufficient to notify and direct people to the needed description for
>>> this.
>>
>> After explaining the usage in short, may be can provide links to
>> all other statements where it can be used, but I think syntax
>> <SET ..
>> FROM CURRENT>
>> should be there with SET command's other syntax.
>
> FROM CURRENT is only valid as part of the SET sub-command attached to CREATE
> FUNCTION.
>
> Yes, a number of SQL commands take a sub-command called SET. These are not
> the same as the Top-level SQL SET command and have their own rules and
> syntax defined on the parent command's page. They share a key word to make
> the grammar and usage saner but these are semantically different statements.
>
> A paragraph cross-referencing where SET sub-commands exist has merit but
> since the main SET command does not accept FROM CURRENT it (FC) should not
> be included in its page directly.

Do you mean to say that SET <var_name> FROM CURRENT doesn't work,
so we don't need on main page?

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-10-01 14:17:55 Re: SSL renegotiation
Previous Message Robert Haas 2013-10-01 14:12:13 Re: Cmpact commits and changeset extraction