Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 82C9847658F for ; Thu, 2 May 2002 18:13:38 -0400 (EDT) Received: from mail1.ihs.com (unknown [170.207.70.222]) by postgresql.org (Postfix) with ESMTP id A5AAA475DAE for ; Thu, 2 May 2002 17:35:09 -0400 (EDT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.3/8.12.3) with ESMTP id g42LXgmc007439; Thu, 2 May 2002 15:33:42 -0600 (MDT) Date: Thu, 2 May 2002 15:31:35 -0600 (MDT) From: Scott Marlowe To: "P. Jourdan" Cc: Subject: Re: column insert In-Reply-To: <5.1.0.14.2.20020502111644.00a8f3b8@mail.host45.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-Archive-Number: 200205/20 X-Sequence-Number: 1152 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.