X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6A32E52A68 for ; Mon, 7 Mar 2005 08:29:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66925-05 for ; Mon, 7 Mar 2005 08:29:47 +0000 (GMT) Received: from web51402.mail.yahoo.com (web51402.mail.yahoo.com [206.190.38.181]) by svr1.postgresql.org (Postfix) with SMTP id 9AAA952A5C for ; Mon, 7 Mar 2005 08:29:45 +0000 (GMT) Received: (qmail 2335 invoked by uid 60001); 7 Mar 2005 08:29:43 -0000 Message-ID: <20050307082943.2333.qmail@web51402.mail.yahoo.com> Received: from [84.247.192.193] by web51402.mail.yahoo.com via HTTP; Mon, 07 Mar 2005 09:29:43 CET Date: Mon, 7 Mar 2005 09:29:43 +0100 (CET) From: Mauro Bertoli Subject: Re: Postgres performance To: PFC Cc: pgsql-sql@postgresql.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.312 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200503/118 X-Sequence-Number: 20597 > > Yes, you are rigth... my insert/update are very > simple > > and without problems and so I think to use > 'foreign > > key' coded to make faster/simpler the management > and > > don't overloading the db (and use exception code > > management )... but I had a problem with pgSQL > because > > server was very busy and the same query was > replicate > > (because users refresh the page... :( ) so now > I've > > foreign keys... > > It's a typical case, program being stopped between > insertion of parent > and child row. Although in this case FK's is not the > solution, > transactions are. I insert a tuple (in the table answers) if the key 'iduser->idquestion' don't exists but when the key exists I update the value; this is coded in php because I have thought that otherwise I must use functions... there's no parent/child rows... how can I use transactions here? Mauro ___________________________________ Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo ora! http://it.messenger.yahoo.it