From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dennis <dennis.verbeek@victorem.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Uniform UPDATE queries
Date: Wed, 18 Apr 2012 12:24:27 -0400
Message-ID: <4420.1334766267@sss.pgh.pa.us> (raw)
In-Reply-To: <4F8E936A.9050303@victorem.com>
References: <4F8E936A.9050303@victorem.com>
Dennis <dennis.verbeek@victorem.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, dennis.verbeek@victorem.com
Subject: Re: Uniform UPDATE queries
In-Reply-To: <4420.1334766267@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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