Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread John Siracusa
On 3/22/06 9:43 PM, Sean Davis wrote: > No error. I just got truncated insertion (presumably from a \000?). Ah, yeah, it does seem to truncate on null bytes: my $o1 = Foo->new(b => "\001\000\003"); $o1->save; my $o2 = Foo->new(id => $o1->id); $o2->load; print unpack('H*', $o1->b), "

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread Sean Davis
On 3/22/06 21:31, "John Siracusa" <[EMAIL PROTECTED]> wrote: > On 3/22/06 8:48 PM, John Siracusa wrote: >> Looking here: >> >> http://www.postgresql.org/docs/8.1/interactive/datatype-binary.html >> >> it seems that there's already an ASCII-ified format for bytea columns. > > Furthermore, byt

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread John Siracusa
On 3/22/06 8:48 PM, John Siracusa wrote: > Looking here: > > http://www.postgresql.org/docs/8.1/interactive/datatype-binary.html > > it seems that there's already an ASCII-ified format for bytea columns. Furthermore, bytea data seems to round-trip just fine without any fancy DBI stuff: # Inse

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread John Siracusa
On 3/22/06 8:38 PM, Daniel Pittman wrote: > Daniel Pittman <[EMAIL PROTECTED]> writes: >> Sean Davis <[EMAIL PROTECTED]> writes: >>> Just tried it and Base64 encoding works fine. I can presumably >>> inflate and deflate within my RDBO class. Thanks for the idea. >> >> Presumably that works becau

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread Daniel Pittman
Daniel Pittman <[EMAIL PROTECTED]> writes: [ahem. wrong keystroke, so the rest of my message follows] > Sean Davis <[EMAIL PROTECTED]> writes: >> On 3/22/06 2:39 PM, "Sean Davis" <[EMAIL PROTECTED]> wrote: >>> On 3/22/06 1:36 PM, "John Siracusa" <[EMAIL PROTECTED]> wrote: On 3/22/06, Sean Da

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread Daniel Pittman
Sean Davis <[EMAIL PROTECTED]> writes: > On 3/22/06 2:39 PM, "Sean Davis" <[EMAIL PROTECTED]> wrote: >> On 3/22/06 1:36 PM, "John Siracusa" <[EMAIL PROTECTED]> wrote: >>> On 3/22/06, Sean Davis <[EMAIL PROTECTED]> wrote: Why is the type for "contents" a scalar? >>> >>> Because that's the defa

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread John Siracusa
On 3/22/06 6:45 PM, Sean Davis wrote: > Just tried it and Base64 encoding works fine. I can presumably inflate and > deflate within my RDBO class. Thanks for the idea. Yeah, using column triggers...but if you're feeling energetic, you could also make a proper "blob" column class and associated m

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread Sean Davis
On 3/22/06 2:39 PM, "Sean Davis" <[EMAIL PROTECTED]> wrote: > > > > On 3/22/06 1:36 PM, "John Siracusa" <[EMAIL PROTECTED]> wrote: > >> On 3/22/06, Sean Davis <[EMAIL PROTECTED]> wrote: >>> Why is the type for "contents" a scalar? >> >> Because that's the default when there is not a more s

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread Sean Davis
On 3/22/06 1:36 PM, "John Siracusa" <[EMAIL PROTECTED]> wrote: > On 3/22/06, Sean Davis <[EMAIL PROTECTED]> wrote: >> Why is the type for "contents" a scalar? > > Because that's the default when there is not a more specific RDBO > column type mapped to whatever DBI returns for the column type.

Re: [RDBO] Postgres and bytea columns

2006-03-22 Thread John Siracusa
On 3/22/06, Sean Davis <[EMAIL PROTECTED]> wrote: > Why is the type for "contents" a scalar? Because that's the default when there is not a more specific RDBO column type mapped to whatever DBI returns for the column type. > I would like to store binary data in that column, which I can do with st

[RDBO] Postgres and bytea columns

2006-03-22 Thread Sean Davis
I have a simple table description for storing files. I store the files in the "contents" column. I also have a simple RDBO class that autoinitializes from the database. The output of the meta->perl_class_definition is given below the table definition. Why is the type for "contents" a scalar? I

Re: [RDBO] Reusing Rose::DB::Objects

2006-03-22 Thread John Siracusa
On 3/22/06, Sean Davis <[EMAIL PROTECTED]> wrote: > I would like to do a large amount of read->parse->store operations. In > short, I have a large text file with one record per line. To speed things > up, I have seen others "reuse" objects rather than allocating new ones for > each record. Can I

[RDBO] Reusing Rose::DB::Objects

2006-03-22 Thread Sean Davis
I would like to do a large amount of read->parse->store operations. In short, I have a large text file with one record per line. To speed things up, I have seen others "reuse" objects rather than allocating new ones for each record. Can I safely do this with Rose::DB::Objects? Is it as simple a