pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@ihs.com>
To: P. Jourdan <pippo@videotron.ca>
Cc: pgsql-php@postgresql.org
Subject: Re: column insert
Date: Thu, 2 May 2002 15:31:35 -0600 (MDT)
Message-ID: <Pine.LNX.4.33.0205021530580.5658-100000@css120.ihs.com> (raw)
In-Reply-To: <5.1.0.14.2.20020502111644.00a8f3b8@mail.host45.com>

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.





view thread (2+ messages)

Message-ID: <Pine.LNX.4.33.0205021530580.5658-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0205021530580.5658-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0205021530580.5658-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: scott.marlowe@ihs.com, pippo@videotron.ca
  Subject: Re: column insert
  In-Reply-To: <Pine.LNX.4.33.0205021530580.5658-100000@css120.ihs.com>
  References: <5.1.0.14.2.20020502111644.00a8f3b8@mail.host45.com> <Pine.LNX.4.33.0205021530580.5658-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox