Re: proposal: doc: simplify examples of dynamic SQL

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: doc: simplify examples of dynamic SQL
Date: 2015-03-21 02:02:26
Message-ID: 20150321020226.GE13192@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 20, 2015 at 06:53:29PM -0700, David G. Johnston wrote:
> On Friday, March 20, 2015, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> On Fri, Mar 20, 2015 at 05:50:03PM -0700, David G. Johnston wrote:
> > ​I'm not sure that this particular feature of the standard is something
> we
> > should encourage.
> >
> > Its actually quite useful in this situation, and so maybe the novelty is
> just
> > making me nervous,​ but the only reason I know of this behavior is
> because I've
> > seen a number of posts in just the past couple of years when people
> > accidentally used this feature and then were surprised when they didn't
> get an
> > error.  If this stays I would suggest that we take the opportunity to
> > cross-reference back to where the syntax is defined so people aren't left
> > scratching their heads as to why it works - or why if they remove the
> newline
> > in their own attempt the code suddenly breaks.
>
> Yeah, I am kind on the fence about it, but it is a nice feature,
> particulary for PL/pgSQL programs.  I added a mention of the string
> concatentation feature --- patch attached, and URL updated.
>
>
>
> The third option is to just embed a new line in the string itself.
>
> Execute Format(’...
> ...', tbl)
> USING val

True, but that just looks odd.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2015-03-21 02:10:34 Re: Abbreviated keys for Numeric
Previous Message Bruce Momjian 2015-03-21 02:00:48 Re: GSSAPI, SSPI - include_realm default