Is it really binary data that your want to store? I suggest you serialize to a variable and log it before guessing what's happening. Also enable DBI trace mode to see what queries get executed: https://metacpan.org/module/DBI#TRACING
Best regards, Alex Am 2012-01-25 18:15, schrieb Jared Watkins: > I've tried storing the data a few different ways.. and I always end up with > the same 3 byte value stored in the database... which sounds like a memory > pointer rather than data. I found a specific reference under DBD:Pg about > binary data.. and it suggests that you have to do an explicit bind and tell > it you are passing binary data like so: > > bind_param(1, $cdr, { pg_type => PG_BYTEA }) > > You don't expose the DBI stuff directly though.. so it looks like that would > require a change or code addition to your sql module to allow separate calls > to prepare, bind, execute. > > I've not had time to setup a totally separate test to take Radiator out of > the equation.. but that's my best guess as to why it's not working at the > moment. > > J > > > On Jan 25, 2012, at 8:01 AM, Heikki Vatiainen wrote: > >> On 01/25/2012 05:44 AM, Jared Watkins wrote: >> >>> I figured out that I have to call it directly like Storable::nfreeze(\%x) >>> but the error I was getting for other way was: >>> >>> Bizarre copy of HASH in refgen at >>> >>> Now.. I'm passing the value in as a bound parameter in the hook and >>> according to a length call on the variable.. it's going in with an average >>> length of 1450 bytes. However.. when I fetch it from the database >>> (postgres) I'm only getting back 3 bytes. >>> >>> I'm using just the attributes list out of the $p variable by >>> $p->{'Attributes'}. >> Try @{$p->{Attributes}} if you want to access the attribute array >> instead of reference. Maybe you are already doing this, but I thought >> I'd check. Also Data::Dumper has sometimes been quite helpful figuring >> out how various items are composed. >> >>> I've done binary data through DBI before (to mysql) without a problem.. so >>> I'm not sure where it might be getting lost here. >> Hard to tell. I have not tried this myself. >> >> Please keep us posted how it goes. >> >> Thanks! >> Heikki >> >>> Thanks, >>> Jared >>> >>> >>> On Jan 24, 2012, at 5:59 PM, Heikki Vatiainen wrote: >>> >>>> On 01/24/2012 10:44 PM, Jared Watkins wrote: >>>> >>>>> I'm seeing some weird errors and behavior trying to use the freeze method >>>>> from Storable. Is there a special trick to making it work in hook code? >>>> I have not used Storable myself, but if you could reply with some >>>> examples I can take a a look. >>>> >>>> Note that some of the data structures, such as radius requests ($p >>>> usually) are very large. You could see e.g. with Data::Dumper to see >>>> what they look like. >>>> >>>>> I saw a reference on the cpan page for special handling when used in a >>>>> 'Safe' compartment.. is that what's happening here? For reference.. for >>>>> development/debugging I'm attempting to serialize and store (in db field) >>>>> a hash I'm creating with all the per packet name-value pairs. >>>> Hard to tell. Examples would be useful :) >>>> >>>> Thanks! >>>> Heikki >>>> >>>> -- >>>> Heikki Vatiainen<h...@open.com.au> >>>> >>>> Radiator: the most portable, flexible and configurable RADIUS server >>>> anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, >>>> Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, >>>> TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP, >>>> DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, >>>> NetWare etc. >>> _______________________________________________ >>> radiator mailing list >>> radiator@open.com.au >>> http://www.open.com.au/mailman/listinfo/radiator >> >> -- >> Heikki Vatiainen<h...@open.com.au> >> >> Radiator: the most portable, flexible and configurable RADIUS server >> anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, >> Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, >> TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP, >> DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, >> NetWare etc. > _______________________________________________ > radiator mailing list > radiator@open.com.au > http://www.open.com.au/mailman/listinfo/radiator *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* _______________________________________________ radiator mailing list radiator@open.com.au http://www.open.com.au/mailman/listinfo/radiator