column insert

column insert

am 02.05.2002 17:24:24 von pippo

I have to insert 2 columns into an existing database that seems to be
altered after a restore. I do not know what datatype should be entered for
"path" and for "referer". The others are int4 and timestamptz for when_stamp.
Here is the code:
/*
* Statistics: write page view
*/
if($loglevel>=1) {
sqlquery("
insert into visits (session_id,page_id,when_stamp,path,referer)
select session_id,$page_id,'now','$REQUEST_URI','$HTTP_REFERER'
from session
where hash='$sid'");
}
Thanks for any help.
Phil Jourdan


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Re: column insert

am 02.05.2002 23:31:35 von Scott Marlowe

On Thu, 2 May 2002, P. Jourdan wrote:

> I have to insert 2 columns into an existing database that seems to be
> altered after a restore. I do not know what datatype should be entered for
> "path" and for "referer". The others are int4 and timestamptz for when_stamp.
> Here is the code:
> /*
> * Statistics: write page view
> */
> if($loglevel>=1) {
> sqlquery("
> insert into visits (session_id,page_id,when_stamp,path,referer)
> select session_id,$page_id,'now','$REQUEST_URI','$HTTP_REFERER'
> from session
> where hash='$sid'");
> }

You're probably best off using text type. Try this:

alter table visits add path text;
alter table visits add referer text;

That should get ya there.



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster