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

Insert vs Update syntax

From: Clodoaldo <clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com>
To: "PostgreSQL - General ML" <pgsql-general(at)postgresql(dot)org>
Subject: Insert vs Update syntax
Date: 2008-02-29 16:17:20
Message-ID: a595de7a0802290817w4ae2244i915d7d308a4c4bbd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
When inserting into a table and there are many columns to be inserted
it is hard to synchronize columns to values:

insert into my_table (
	a,
	b,
	c,
	...many more columns
)values(
	@a,
	@b,
	@c,
	... the corresponding values
)

Is there some reason for the insert syntax to be the way it is in
instead of the much easier to get it right Update syntax?:

update my_table
set a = @a,
b = @b,
c = @c,
...

Regards, Clodoaldo Pinto Neto

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2008-02-29 16:19:20
Subject: Re: errors in pg_restore on windows?
Previous:From: Dan ArmbrustDate: 2008-02-29 15:40:44
Subject: Re: errors in pg_restore on windows?

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