Skip site navigation (1) Skip section navigation (2)

Re: Uniform UPDATE queries

From: Dennis <dennis(dot)verbeek(at)victorem(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Uniform UPDATE queries
Date: 2012-04-19 10:55:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hello Tom,

The example you have given is EXACTLY why something like CURRENT is needed to limit the number of 
unique queries or prepared statements. (or to do a selection of all values before an update meaning 
two executed queries.)



On 04/18/2012 06:24 PM, Tom Lane wrote:
> Dennis<dennis(dot)verbeek(at)victorem(dot)com>  writes:
>> When a query is written to update a table, the usual process is to list all the columns that need
>> updating. This could imply the creation of many possible queries for many columns. In an effort to
>> keep the UPDATE queries more uniform, less number of unique queries, a keyword similar to DEFAULT,
>> let's say CURRENT, is required to indicate that the current value must not change.
> No it isn't.  Just write the name of the column, eg
> 	update mytable set x = x, y =<new value>, z = z where ...
> There's no reason to invent nonstandard syntax for this.
> 			regards, tom lane

In response to


pgsql-sql by date

Next:From: thomas veymontDate: 2012-04-19 11:56:16
Subject: Re: plpgsql : adding record variable to table
Previous:From: Pavel StehuleDate: 2012-04-19 10:08:18
Subject: Re: plpgsql : adding record variable to table

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group