"on existing update" construct
Hello,
Is there an alternative of Sybase "on existing update" construct in pgsql.
"ON DUPLICATE KEY UPDATE" doesn't work.
Thanks in advance!
Regards - Dev
On Wed, May 15, 2013 at 11:44 AM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:
Hello,
Is there an alternative of Sybase "on existing update" construct in pgsql.
"ON DUPLICATE KEY UPDATE" doesn't work.
Thanks in advance!
No, you'll have to either handle this in the application or use a
stored procedure at this time. The omission of such a construct from
psql's "\h" command and the manual is not in error.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Well ya, stored procedure also was thinking about pre-insert trigger.
Am sure folks here must have gone thru this and had alternatives. Also was
reading about merge_by_key.
On Wed, May 15, 2013 at 12:51 PM, Daniel Farina <daniel@heroku.com> wrote:
Show quoted text
On Wed, May 15, 2013 at 11:44 AM, Dev Kumkar <devdas.kumkar@gmail.com>
wrote:Hello,
Is there an alternative of Sybase "on existing update" construct in
pgsql.
"ON DUPLICATE KEY UPDATE" doesn't work.
Thanks in advance!
No, you'll have to either handle this in the application or use a
stored procedure at this time. The omission of such a construct from
psql's "\h" command and the manual is not in error.
On 05/15/2013 02:22 PM, Dev Kumkar wrote:
Well ya, stored procedure also was thinking about pre-insert trigger.
Am sure folks here must have gone thru this and had alternatives. Also was
reading about merge_by_key.
It's been on the TODO list forever. It's harder to implement well than
you would think.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Import Notes
Reply to msg id not found: WMedafba1edb3beb8b9e4a17da55d43c281f64bf39a28bd59b8be23f39fc08645d66b3224f758db97aeec4f583cfd217bb@asav-3.01.com
Please do not top-post on the PostgreSQL lists. See <
http://idallen.com/topposting.html>
Also, note that pgsql-hackers is entirely the wrong list for this sort of
question. You should have been asking on pgsql-general.
Apologies for top-post!
Well I thought pgsql-hackers will suggest some new solution was just going
by the description of mailing-list. Its worth looking into
http://stackoverflow.com/questions/1109061/insert-on-duplicate-update-postgresql
Let me know and I will post this question on pgsql-general.
It's been on the TODO list forever. It's harder to implement well than
you would think.
Yes, I think it be nice to see this in one of the upcoming releases.
Thanks!
Basically I was referring to this link http://mbk.projects.postgresql.org
Any suggestions here?
Thanks!
On 05/16/2013 02:44 AM, Dev Kumkar wrote:
Hello,
Is there an alternative of Sybase "on existing update" construct in pgsql.
No.
See:
http://www.depesz.com/2012/06/10/why-is-upsert-so-complicated/
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers