I use stored procedures :

create function insertorupdate(....)
        UPDATE mytable WHERE ... SET ...
        IF NOT FOUND THEN
                INSERT INTO mytable ...
        END IF;


You lose flecibility in your request though.

I wish Postgresql had an INSERT OR UPDATE like MySQL does. So far it's the only thing that I regret from MySQL.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to [EMAIL PROTECTED] so that your
     message can get through to the mailing list cleanly

Reply via email to