On Fri, Mar 20, 2015 at 04:28:38PM -0400, Bruce Momjian wrote:
On Fri, Mar 20, 2015 at 08:43:21AM -0700, David G. Johnston wrote:
On Thu, Mar 19, 2015 at 6:49 PM, Bruce Momjian br...@momjian.us wrote:
It is making a point about nulls and stuff. There are later queries
that use
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
On Friday, March 20, 2015, Bruce Momjian br...@momjian.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
On Fri, Mar 20, 2015 at 1:47 PM, Alvaro Herrera alvhe...@2ndquadrant.com
wrote:
Bruce Momjian wrote:
On Fri, Mar 20, 2015 at 08:54:24AM -0700, David G. Johnston wrote:
1. The layout of the format version is different, with respect to
newlines,
than the quote version; but while using
On Fri, Mar 20, 2015 at 06:53:29PM -0700, David G. Johnston wrote:
On Friday, March 20, 2015, Bruce Momjian br...@momjian.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
On Thu, Mar 19, 2015 at 6:49 PM, Bruce Momjian br...@momjian.us wrote:
On Thu, Mar 19, 2015 at 06:05:52PM -0700, David G. Johnston wrote:
On Thu, Mar 19, 2015 at 5:18 PM, Bruce Momjian br...@momjian.us wrote:
There are other places later in the docs where we explain all the quote*
Looking at
http://momjian.us/tmp/pgsql/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
The paired example at the top of the patch has two things worth considering.
1. The layout of the format version is different, with respect to newlines,
than the quote version; but while using
On Fri, Mar 20, 2015 at 05:47:49PM -0300, Alvaro Herrera wrote:
Bruce Momjian wrote:
On Fri, Mar 20, 2015 at 08:54:24AM -0700, David G. Johnston wrote:
1. The layout of the format version is different, with respect to
newlines,
than the quote version; but while using newlines for
Bruce Momjian wrote:
On Fri, Mar 20, 2015 at 05:47:49PM -0300, Alvaro Herrera wrote:
BTW very long lines are undesirable because they are truncated in the
PDF output.
True, but the length was only 95 characters --- is that too long for our
PDFs?
I built some PDFs when I did the ALTER
On Fri, Mar 20, 2015 at 06:05:35PM -0300, Alvaro Herrera wrote:
Bruce Momjian wrote:
On Fri, Mar 20, 2015 at 05:47:49PM -0300, Alvaro Herrera wrote:
BTW very long lines are undesirable because they are truncated in the
PDF output.
True, but the length was only 95 characters --- is
On Fri, Mar 20, 2015 at 08:43:21AM -0700, David G. Johnston wrote:
On Thu, Mar 19, 2015 at 6:49 PM, Bruce Momjian br...@momjian.us wrote:
It is making a point about nulls and stuff. There are later queries
that use format().
I thought maybe you meant those but your specific mention
On Fri, Mar 20, 2015 at 08:54:24AM -0700, David G. Johnston wrote:
Looking at http://momjian.us/tmp/pgsql/plpgsql-statements.html#
PLPGSQL-STATEMENTS-EXECUTING-DYN
The paired example at the top of the patch has two things worth considering.
1. The layout of the format version is
Bruce Momjian wrote:
On Fri, Mar 20, 2015 at 08:54:24AM -0700, David G. Johnston wrote:
1. The layout of the format version is different, with respect to newlines,
than the quote version; but while using newlines for the mandatory
concatenation is good having an excessively long format
On Thu, Mar 19, 2015 at 5:18 PM, Bruce Momjian br...@momjian.us wrote:
On Thu, Mar 19, 2015 at 04:01:32PM -0700, David G. Johnston wrote:
Prefacing it with: You may also see the following syntax in the wild
since
format was only recently introduced.
may solve your lack of reason for
On Thu, Oct 2, 2014 at 09:06:54PM -0700, David G Johnston wrote:
Jim Nasby-5 wrote
On 10/2/14, 6:51 AM, Pavel Stehule wrote:
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = %L',
colname, keyvalue)
or
-1, because of quoting issues
EXECUTE format('UPDATE
On Thu, Mar 19, 2015 at 3:38 PM, Bruce Momjian br...@momjian.us wrote:
On Thu, Oct 2, 2014 at 09:06:54PM -0700, David G Johnston wrote:
Jim Nasby-5 wrote
On 10/2/14, 6:51 AM, Pavel Stehule wrote:
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = %L',
On Thu, Mar 19, 2015 at 04:01:32PM -0700, David G. Johnston wrote:
Doing some research on EXECUTE, I found that for constants, USING is
best because it _conditionally_ quotes based on the data type, and for
identifiers, format(%I) is best.
On a nit-pick note, ISTM that
On Thu, Mar 19, 2015 at 06:05:52PM -0700, David G. Johnston wrote:
On Thu, Mar 19, 2015 at 5:18 PM, Bruce Momjian br...@momjian.us wrote:
There are other places later in the docs where we explain all the quote*
functions and show examples of query construction using string
On 10/2/14, 11:06 PM, David G Johnston wrote:
Jim Nasby-5 wrote
On 10/2/14, 6:51 AM, Pavel Stehule wrote:
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = %L',
colname, keyvalue)
or
-1, because of quoting issues
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE
Hi
There are few less readable examples of dynamic SQL in plpgsql doc
like:
EXECUTE 'SELECT count(*) FROM '
|| tabname::regclass
|| ' WHERE inserted_by = $1 AND inserted = $2'
INTO c
USING checked_user, checked_date;
or
EXECUTE 'UPDATE tbl SET '
|| quote_ident(colname)
On 10/2/14, 6:51 AM, Pavel Stehule wrote:
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = %L',
colname, keyvalue)
or
-1, because of quoting issues
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = $1',
colname)
USING keyvalue;
Better,
Jim Nasby-5 wrote
On 10/2/14, 6:51 AM, Pavel Stehule wrote:
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = %L',
colname, keyvalue)
or
-1, because of quoting issues
EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = $1',
colname)
22 matches
Mail list logo