Skip site navigation (1) Skip section navigation (2)

Re: temp tables

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "Cima" <ruel(dot)cima(at)facinf(dot)uho(dot)edu(dot)cu>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: temp tables
Date: 2005-04-28 12:18:19
Message-ID: 9B15E96C-B7DF-11D9-A5B4-000A95B03262@pgedit.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Apr 28, 2005, at 12:45 AM, Cima wrote:

>
> im working with php 4 and postgresql 8 and in my php script id like to 
> create a temp table on my database server. how do i do this? how do i 
> verify it was created?
>  
> i tried the following:
>  
> $sql = "create temp table s_info(a int, b text) on commit delete 
> rows ";
>  
> pg_query($dbh,$sql);
>  
>  
> $dbh is my connection.
>  
> any help will be highly appreciated.


You can verify it was created by checking the result from pg_query and 
looking at pg_last_error. The table is automatically dropped at the end 
of the connection, most likely when your PHP script ends.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


In response to

pgsql-novice by date

Next:From: andras-listDate: 2005-04-28 12:55:43
Subject: pg8.0.2 win install
Previous:From: Jessica DittDate: 2005-04-28 12:11:29
Subject: Problem with DirectFunctionCall3(array_in,...)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group