pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bboett@erm1.u-strasbg.fr
To: pgsql-sql@postgresql.org
Subject: replace??
Date: Tue, 19 Dec 2000 13:37:52 +0100
Message-ID: <20001219133752.C9283@erm1.u-strasbg.fr> (raw)

hello,

i have the following problem:
i have in php an array structure with user-prefs that have to be stored
onto DB....

actually i look up if the corresponding entry exists (comparing
user-name and field-name) if yes i update, if no i insert....

this isn't very appealing, but i couldn't find another way yet to make
this shorter...

would be nice if something like the following existed:

replace settings set auser='toto',field='lang',data='fr' where
auser='toto' and field='lang';

update settings set auser='toto',field='lang',data='fr' where
auser='toto' and field='lang' REPLACE;

or even better:

replace settings keys(auser,field) set auser='toto',field='lang',data='fr';


-- 
ciao bboett
==============================================================
bboett@earthling.net
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===============================================================
the total amount of intelligence on earth is constant.
human population is growing....



view thread (6+ messages)  latest in thread

Message-ID: <20001219133752.C9283@erm1.u-strasbg.fr>
Permalink:  ../20001219133752.C9283@erm1.u-strasbg.fr/
Also on:    postgresql.org/message-id/20001219133752.C9283@erm1.u-strasbg.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bboett@erm1.u-strasbg.fr
  Subject: Re: replace??
  In-Reply-To: <20001219133752.C9283@erm1.u-strasbg.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox