Replace into... - Mailing list pgsql-novice

From Boget, Chris
Subject Replace into...
Date
Msg-id 4040BBE81A9AD411BD27009027887A7C0431DA@tiger.wild.net
Whole thread Raw
Responses Re: Replace into...  (brew@theMode.com)
List pgsql-novice

Coming from MySQL, I'm kind of sad to learn that
"REPLACE INTO" isn't part of Postgres.  However,
I understand totally why it is not.

The problem, though, is that I need this type of
functionality... To INSERT or UPDATE depending on
whether or not the record is already there.  I've
spent the last several hours trying to figure out
how I can set up a trigger to do this.  Searching
on Google and Yahoo turns up obscure references
to this approach but can't find anything a bit more
informative.

I've tried going to the postgresql.org website to
look at the docs (again; I searched last night but
couldn't come up with anything I could see with
my noobie eyes that could help me) but the site
appears to be down.

Could someone give me an example, or point me in
the right direction to a trigger that would act
like a "REPLACE INTO"?

If possible, could you also CC me at

jcboget
at
yahoo
dot
com

as this is my work address (that I'm accessing
from home) and the interface to read the mail is
very poor.

I appreciate any assistance you can provide!!

thnx,
Christoph

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: changing ownership of db
Next
From: brew@theMode.com
Date:
Subject: Re: Replace into...