pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Suggested changes to plpgsql-structure section of plpgsql
2+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2017-07-17 533463307b 236bdae543 6b62312572 0873092dd3 a64726e7a5 2d08d036ea  Doc: explain dollar quoting in the intro part of the pl/pgsql chapter.
* Suggested changes to plpgsql-structure section of plpgsql
@ 2017-06-25 03:20  Kurt Kartaltepe <kkartaltepe@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Kurt Kartaltepe @ 2017-06-25 03:20 UTC (permalink / raw)
  To: pgsql-docs

I suggested this in IRC and they recommended sending it to this
mailing list, at
https://www.postgresql.org/docs/9.6/static/plpgsql-structure.html when
introducing plpgsql functions the double dollar quote is used and
assumes the user is familiar with it. In my experience people may
happen across this while still being unfamiliar with this syntax and
be further confused as they go through the plpgsql section.

My suggestion is to add in a mention that using the double dollar
syntax is typical for function body declarations and provide a link to
the https://www.postgresql.org/docs/9.6/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
section similar to what is provided in the
https://www.postgresql.org/docs/9.6/static/sql-createfunction.html
'definition' section.

Something like a new TIP or NOTE box with (text mostly taken from the
sql-createfunction section):
Because the function definition is a string literal, it is often
helpful to use dollar quoting (see Section 4.1.2.4), rather than the
normal single quote syntax. Without dollar quoting, any single quotes
or backslashes in the function definition must be escaped by doubling
them.

--Kurt Kartaltepe


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Suggested changes to plpgsql-structure section of plpgsql
@ 2017-07-17 20:45  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Kurt Kartaltepe <kkartaltepe@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-07-17 20:45 UTC (permalink / raw)
  To: Kurt Kartaltepe <kkartaltepe@gmail.com>; +Cc: pgsql-docs

Kurt Kartaltepe <kkartaltepe@gmail.com> writes:
> My suggestion is to add in a mention that using the double dollar
> syntax is typical for function body declarations and provide a link to
> the https://www.postgresql.org/docs/9.6/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
> section similar to what is provided in the
> https://www.postgresql.org/docs/9.6/static/sql-createfunction.html
> 'definition' section.

Seems like a good idea, done:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=533463307bf67e1bb7acc345ba7ea535c...

			regards, tom lane


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-07-17 20:45 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-06-25 03:20 Suggested changes to plpgsql-structure section of plpgsql Kurt Kartaltepe <kkartaltepe@gmail.com>
2017-07-17 20:45 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox