[horde] pgsql_sessionhandler.sql not working?

Ron Cooper rcooper at jamesconeyisland.com
Wed Jul 9 10:37:32 PDT 2003


Quoting "Marcus I. Ryan" <marcus at horde.org>:

> Quoting Ron Cooper <rcooper at jamesconeyisland.com>:
>
>> Quoting imp <imp at xtremedev.com>:
>> Short answer is I think sql.php for pgsql is broken for session
>> handling
>> because of the session_data field in the postgres table is defined
>> as TEX, but sql.php assumes it's Binary.
>
> Not true.  If you look at SQL.php *Blob functions for pgsql, these
> functions bin2hex and reverse the process when storing and retrieving
> respectively.  This is probably not the "best" way to do this, though
> no one has made it work with bytea to do comparitive analysis of
> performance - we either bin2hex the entire thing or parse the string
> to properly quote binary data.  I'm not sure which is faster, but the
> former is easier and more reliable.

Especially with the special escape sequences BYTEA needs in the strings,
which would generally make it far more complex than necessary.


> > is set to TEXT.  So sql.php was obviously trying to send binary
> >session
>  >data to a text field, and well it probably truncated on the first
> > EOF
> > char sent to it.
>
> > So is the table defined wrong or is the support lacking in sql.php
> > for
> > TEXT or BYTEA defined fields?  I suppose you could change the
> > session_data field type from TEXT to BYTEA and use the
> > configuration
> > from before and see if it craps out or not. I have no idea.
>
> The table is correct; there is no support in SQL.php for bytea.  It
> would be nice if you actually checked before you tell the world how
> to fix a problem you're just guessing about.

*SNIF* you hurt my feelings and made me cry.
Seriourly, I thought I was clear it was just all conjecture, but at
least it envoked a response and now we know how it works.  Thanks.

> All that said, I still haven't gotten pgsql sessions working
> perfectly, but they are working at least enough to get logged in.
> The problems I had are most likely with the updateBlob, but I haven't
> had time to debug anything.  The problem I had is the session data
> would periodically not get updated.  The session would fail to get
> updates from IMP about mailbox, messages, etc.  I reverted back and
> haven't use it since.

Guess it depends on how efficient the conversion routines are.
BYTEA invokes a 4 byte overhead for each string, and additional code for
the parsing, like you said, someone would have to benchmark it, write
the parser, any gain may not be worth the effort.

Thanks for your reply.

Ron

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 963 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/horde/attachments/20030709/f6dfc37d/attachment-0002.bin


More information about the horde mailing list