Re: Insert vs Update syntax - Mailing list pgsql-general

From Kaloyan Iliev
Subject Re: Insert vs Update syntax
Date
Msg-id 47C83953.9000108@digsys.bg
Whole thread Raw
In response to Re: Insert vs Update syntax  (Clodoaldo <clodoaldo.pinto.neto@gmail.com>)
List pgsql-general
Hi,<br /><br /> I've solved this problem for me (Perl). I have a module DBAPI and write a function
InsertIntoTable($table_name,$hash_with_values, $data_base_handler).<br /> I send the parms to the function in the hash
(key1=> value1, key2 => value2 ...) and in the function I compose the insert and execute it.<br /><br /> INSERT
INTO$table_name (key1, key2, key3) VALUES (value1, value2, value3);<br /><br /> So I suggest you write such function
andsolve most of your problems:-)<br /><br /> Regards, <br />   Kaloyan Iliev<br />  <br /> Clodoaldo wrote:
<blockquotecite="mida595de7a0802290831y785c402ewcf9abdec00dac9e8@mail.gmail.com" type="cite"><pre wrap="">2008/2/29,
Martijnvan Oosterhout <a class="moz-txt-link-rfc2396E" href="mailto:kleptog@svana.org"><kleptog@svana.org></a>:
</pre><blockquotetype="cite"><pre wrap="">On Fri, Feb 29, 2008 at 01:17:20PM -0300, Clodoaldo wrote:> When inserting
intoa table and there are many columns to be inserted> it is hard to synchronize columns to values:
 


<snip>

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


Because it's what the SQL standard says. If you don't like it I suggestyou take it up with them... But it's a little
lateto change now Ithink.   </pre></blockquote><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
group.

Regards, Clodoaldo Pinto Neto

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
 </pre></blockquote><br />

pgsql-general by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: partitioning using dblink
Next
From: "Bryan Murphy"
Date:
Subject: Schema Export/Import