Unix Technical Forum

Re: Conditional INSERT: if not exists

This is a discussion on Re: Conditional INSERT: if not exists within the pgsql Novice forums, part of the PostgreSQL category; --> > > > I want to insert a row unless it exists already. Do I have to write a ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:07 PM
Don Morrison
 
Posts: n/a
Default Re: Conditional INSERT: if not exists

> > > I want to insert a row unless it exists already. Do I have to write a
> > > stored procedure to do this?

> >[...]
> > isn't a problem. If you need to do this in a transaction, you can
> > simply set savepoints and roll back to the savepoint if an insert fails
> > (and you expected that it could).

> Yes, that's the problem: I have it in one transaction which I don't
> want to fail on error. I'll look into the savepoint method.
> Specifically the transaction I'm writing is a "Z SQL Method" in Zope
> (a page templating system and web server).


I'll have to upgrade to PostgreSQL 8.X. 7.X doesn't have savepoint.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com