Received: from erm1.u-strasbg.fr (erm1.u-strasbg.fr [130.79.74.61]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBJCbW676810 for ; Tue, 19 Dec 2000 07:37:32 -0500 (EST) (envelope-from bboett@erm1.u-strasbg.fr) Received: by erm1.u-strasbg.fr (Postfix, from userid 501) id 9A9A25F05; Tue, 19 Dec 2000 13:37:52 +0100 (CET) Date: Tue, 19 Dec 2000 13:37:52 +0100 To: pgsql-sql@postgresql.org Subject: replace?? Message-ID: <20001219133752.C9283@erm1.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i From: bboett@erm1.u-strasbg.fr (Bruno Boettcher) X-Archive-Number: 200012/210 X-Sequence-Number: 544 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....