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

Re: Insert vs Update syntax

From: Kaloyan Iliev <kaloyan(at)digsys(dot)bg>
To: Clodoaldo <clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Insert vs Update syntax
Date: 2008-02-29 16:56:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=windows-1251"
<body bgcolor="#ffffff" text="#000000">
I've solved this problem for me (Perl). I have a module DBAPI and write
a function InsertIntoTable($table_name, $hash_with_values,
I send the parms to the function in the hash (key1 =&gt; value1, key2
=&gt; value2 ...) and in the function I compose the insert and execute
INSERT INTO $table_name (key1, key2, key3) VALUES (value1, value2,
So I suggest you write such function and solve most of your problems:-)<br>
Regards, <br>
  Kaloyan Iliev<br>
Clodoaldo wrote:
  <pre wrap="">2008/2/29, Martijn van Oosterhout <a class="moz-txt-link-rfc2396E" href="mailto:kleptog(at)svana(dot)org">&lt;kleptog(at)svana(dot)org&gt;</a>:
  <blockquote type="cite">
    <pre wrap="">On Fri, Feb 29, 2008 at 01:17:20PM -0300, Clodoaldo wrote:
 &gt; When inserting into a table and there are many columns to be inserted
 &gt; it is hard to synchronize columns to values:


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

Because it's what the SQL standard says. If you don't like it I suggest
 you take it up with them... But it's a little late to change now I
  <pre wrap=""><!---->
I know about the standards and I'm not blaming postgresql. I just want
to know if it is worth to bring the the matter to some responsible

Regards, Clodoaldo Pinto Neto

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Attachment: unknown_filename
Description: text/html (1.9 KB)

In response to

pgsql-general by date

Next:From: Scara MaccaiDate: 2008-02-29 16:57:11
Subject: Re: partitioning using dblink
Previous:From: Alvaro HerreraDate: 2008-02-29 16:51:30
Subject: Re: errors in pg_restore on windows?

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