Re: remove undocumented assign syntax from plpgsql doc - Mailing list pgsql-docs

From Pavel Stehule
Subject Re: remove undocumented assign syntax from plpgsql doc
Date
Msg-id CAFj8pRAPNM0__k9FsBJc1ubyHq8xoU0TxgoHdLEud7sV=OaTDA@mail.gmail.com
Whole thread Raw
In response to Re: remove undocumented assign syntax from plpgsql doc  (Bruce Momjian <bruce@momjian.us>)
Responses Re: remove undocumented assign syntax from plpgsql doc  (Bruce Momjian <bruce@momjian.us>)
List pgsql-docs



2014/1/13 Bruce Momjian <bruce@momjian.us>
On Sun, Jan 12, 2014 at 07:00:09AM +0100, Pavel Stehule wrote:
>     Comment updated.  Patch attached.
>
>
>
> Still I am missing message about preferred syntax (or we should to enhance GET
> DIAGNOSTICS doc about proprietary syntax).
>
> PL/pgSQL, PL/SQL is mix of two languages: ADA and SQL - and their designers
> decided so embedded SQL statements will be placed in native SQL syntax (and ADA
> in simplified ADA syntax)
>
> We have to find a agreement what we will prefer for PL/pgSQL:
>
> The assign statement is "ADA" statement - ":=" is preferred
>
> The GET DIAGNOSTICS is "SQL" statement - "=" is preferred
>
> A newer SQL/PSM was designed differently - without this dichotomy - A
> assignment is emphased by syntax SET varname = value
>  
> A proper syntax is good information what is coming from - and It is good mental
> helper to understand a philosophy of stored procedures (that shares concepts
> with PL/SQL). Next argument is similarity with PL/SQL and SQL PL. This
> statement (GET DIAGNOSTICS) is supported on both environments and only "=" is
> allowed there.

I find the rules above so complex that I don't see how we can recommend
a best syntax.  What I did in the patch I just posted was to put the
preferred operator first, but I don't see why we want to get into these
details in the docs.

just a note about preferred variant should be ok. Using ':=' in GET DIAGNOSTICS statement is just bad idea.

Pavel
 

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

pgsql-docs by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Upgrading doc does not mention pg_restore at all
Next
From: Bruce Momjian
Date:
Subject: Re: remove undocumented assign syntax from plpgsql doc