Received: from icebox.venux.net (icebox.venux.net [216.120.166.10]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f33InCK13552 for ; Tue, 3 Apr 2001 14:49:13 -0400 (EDT) (envelope-from mitch@venux.net) Received: from epox450 (net-216-93-125-061.hcv.com [216.93.125.61]) by icebox.venux.net (Postfix) with SMTP id 2F7D026202 for ; Tue, 3 Apr 2001 15:03:06 -0400 (EDT) Message-ID: <00ea01c0bc6e$3bde9040$0b51000a@epox450> From: "Mitch Vincent" To: References: <9a6r0n$2imr$1@news.tht.net> <6660.986323525@sss.pgh.pa.us> Subject: Re: libpq bug? (I guess not) Date: Tue, 3 Apr 2001 14:45:20 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200104/138 X-Sequence-Number: 7214 pg_pconnect is very nasty right now (check the PHP bug list [bugs.php.net] and you'll see many references to it).. They've said that the problems have been (or are being) fixed for the next release of PHP but from what I understand the PHP release won't be for a while. Good luck! -Mitch Software development : You can have it cheap, fast or working. Choose two. ----- Original Message ----- From: "Tom Lane" To: "Yasuo Ohgaki" Cc: Sent: Tuesday, April 03, 2001 2:45 PM Subject: Re: libpq bug? (I guess not) > "Yasuo Ohgaki" writes: > > I have a PHP code to execute query like > > > $db = pg_pconnect('db=my_db host=localhost user=username'); > > $query = "INSERT INTO new_user (username, email, ............) VALUES ('ABC', > > 'foo@example.com', ..........);"; > > pg_exec($db, $query); // Execute query using database connection $db. > > > in my script. The script seems executing the query 4 times whenever it's called, > > since I get 4 newly inserted records everytime execute the script. > > You could get some more info about what's happening by turning on query > logging in the postmaster (start postmaster with -d2, and be sure NOT to > use -S). But I'll bet that some way or other, PHP is submitting the > same query multiple times. > > I have some recollection that pg_pconnect() doesn't behave very well; > you might need to avoid that in favor of a plain connect. Check the > archives for discussion of pconnect. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >