Received: from smtp.noos.fr (camus.noos.net [212.198.2.70]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9E8lOr68002 for ; Sun, 14 Oct 2001 04:47:24 -0400 (EDT) (envelope-from esaracco@noos.fr) Received: (qmail 79287374 invoked by uid 0); 14 Oct 2001 08:47:21 -0000 Received: from unknown (HELO noos.fr) ([212.198.229.109]) (envelope-sender ) by 212.198.2.70 (qmail-ldap-1.03) with SMTP for ; 14 Oct 2001 08:47:21 -0000 Message-ID: <3BC9514E.2060207@noos.fr> Date: Sun, 14 Oct 2001 10:48:14 +0200 From: Emmanuel SARACCO Reply-To: esaracco@noos.fr User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5+) Gecko/20011012 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-php@postgresql.org Subject: Re: temp tables and pg_pconnect() References: <3BC8767C.4080606@noos.fr> <001201c15414$17c12ea0$330a0a0a@rutgersinsurance.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200110/57 X-Sequence-Number: 610 hi adam, thanks for your answer but here is part of my stored procedure: ------------------ CREATE TEMP TABLE res_tot (tot INTEGER); sqlreq := ' INSERT INTO res_tot SELECT count(no_dossier) FROM ' || vs_lb ||' WHERE 1=1 '; IF surf_min>0 THEN sqlreq :=sqlreq||' AND surf_hab >= '|| surf_min ||' '; end if; IF surf_max>0 THEN sqlreq :=sqlreq||' AND surf_hab <= '|| surf_max ||' '; end if; IF prix_min>0 THEN IF devise = 'FRANC' THEN sqlreq :=sqlreq||' AND prix_franc >= '|| prix_min ||' '; ELSE sqlreq :=sqlreq||' AND prix_euro >= '|| prix_min ||' '; END IF; END IF; EXECUTE sqlreq; SELECT INTO resultat tot FROM res_tot; RETURN resultat; ------------------ as you see, I can not create a normal table because of concurrency problems. the solution would be to create a normal table with random generated name but I could not retrieve a value from it with a "execute" instruction... so I think it is impossible for me to use pg_pconnect() :-( bye Adam Lang wrote: > Are temp tables supposed to be destroyed when the connection is cosed? If > so, then the reason is because with pconnect, the connection really is never > killed as far as Postgresql sees it. The connection remains open. > > Can you drop the temp table yourself through the pg_exec comand and just use > DROP TABLE ? > > Adam Lang > Systems Engineer > Rutgers Casualty Insurance Company > http://www.rutgersinsurance.com > ----- Original Message ----- > From: "Emmanuel SARACCO" > To: > Sent: Saturday, October 13, 2001 1:14 PM > Subject: [PHP] temp tables and pg_pconnect() > > > >>hi, >> >>I am using temp tables in stored procedures (I just can not create >>normal tables because I must retreive values from those tables in those >>stored procedures with the "execute" instruction). >> >>doing connexions with pg_connect()/pg_close() on each php page all work >>fine, but when I try to use pg_pconnect() (wich is much more efficient!) >>temp table are not detroyed... >> >>how can I use pg_connect() and continue using temp tables in stored >>procedures? >> >>thanks >> >> >>-- >>Emmanuel SARACCO >>Email: esaracco@noos.fr >> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 4: Don't 'kill -9' the postmaster >> >> > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > > > -- Emmanuel SARACCO Email: esaracco@noos.fr