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

Re: Apache::Session in PostgreSQL

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: Herbert Liechti <Herbert(dot)Liechti(at)thinx(dot)ch>
Cc: postgres <pgsql-general(at)postgresql(dot)org>
Subject: Re: Apache::Session in PostgreSQL
Date: 2000-03-31 23:46:01
Message-ID: 20000331174601.A8028@rice.edu (view raw or flat)
Thread:
Lists: pgsql-general
On Fri, Mar 31, 2000 at 08:53:28PM +0200, Herbert Liechti wrote:
> Victor Manuel Jaquez Leal wrote:
> > 
> > Hi!
> > 
> > I want to use the Apache::Session perl module in my WebApps, but when I
> > try to insert the session tuple, the Postgres can't handle the string and
> > abort the operation.
> 
> I had the same problem ;-(. I found no solution for that so I went to
> store the session parameters in the file system. I'm also interested
> in a solution.
> 
> Below the requirements for the Apache::Session::DbI
> 
> NAME
>        Apache::Session::DBI - Session persistence via DBI
> 
> SCHEMA
>        To use this module, you will need these columns in a table
>        called 'sessions':
> 
>         id char(16)
>         length int(11)
>         a_session text
> 
>        Where the a_session column needs to be able to handle
>        arbitrarily long binary data.

Hmm, you might try the bytea type:

reedstrm=> create table test2 (b bytea, t text);
CREATE
reedstrm=> \d test2
Table    = test2
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| b                                | bytea                            |   var |
| t                                | text                             |   var |
+----------------------------------+----------------------------------+-------+
reedstrm=> insert into test2 values ('abdkrxf\02\v\00fges','abdkrxf\02\v\00fges');
INSERT 937909 1
reedstrm=> select * from test2
reedstrm-> ;
b           |t        
------------+---------
abdkrxf\002v|abdkrxfav
(1 row)

reedstrm=> 

it won't take a byte with value \00, but otherwise might work. Interestingly
enough, the cut and paste into this email deleted the funny 50% gray box
that appeared after the 'xf' in the 't' column.

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

In response to

pgsql-general by date

Next:From: Thomas LockhartDate: 2000-04-01 02:39:06
Subject: Re: [INTERFACES] Problem with Large Object Interface ofpgsql_perl5
Previous:From: K ParkerDate: 2000-03-31 21:46:04
Subject: set timezone to what???

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