Re: COPY not handling BLOBs

Lists: pgsql-general
From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: COPY not handling BLOBs
Date: 2004-08-04 17:17:48
Message-ID: 41111A3C.3000404@ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I have a bunch of data in Sybase and some of it is in image fields. We
use bcp on this data transparently all the time without major issues in
character mode. Is there a fundamental technical reason that BLOBs
can't be COPY'd in postgresql or is it just that nobody has ever wanted
to before?

(If I was starting from scratch I'd probably be happy with
pg_dump/pg_restore, but I'd like to migrate in easy stages over from
Sybase, so I'd like the bcp files to be interchangable.)

Right now I'm having to write a program to create all the large objects
up front and record the OIDs in a file which I will then COPY in with
the rest of my data.


From: Doug McNaught <doug(at)mcnaught(dot)org>
To: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY not handling BLOBs
Date: 2004-08-04 17:51:07
Message-ID: 874qniu704.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

David Rysdam <drysdam(at)ll(dot)mit(dot)edu> writes:

> Right now I'm having to write a program to create all the large
> objects up front and record the OIDs in a file which I will then COPY
> in with the rest of my data.

You might consider using "bytea" instead of large objects, unless you
need the lo_read()/lo_seek() API in your client app... I'm not
super-familiar with how bytea and COPY work together, though.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863


From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To:
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY not handling BLOBs
Date: 2004-08-04 17:58:58
Message-ID: 411123E2.2060205@ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Doug McNaught wrote:

>David Rysdam <drysdam(at)ll(dot)mit(dot)edu> writes:
>
>
>
>>Right now I'm having to write a program to create all the large
>>objects up front and record the OIDs in a file which I will then COPY
>>in with the rest of my data.
>>
>>
>
>You might consider using "bytea" instead of large objects, unless you
>need the lo_read()/lo_seek() API in your client app... I'm not
>super-familiar with how bytea and COPY work together, though.
>
>-Doug
>
>
bytea will only go up to "several thousand bytes" according to the
docs. I assume it's not very precise because the maximum is 8196 -
$other_fields_in_row. My binary data could be a couple times that or
even much bigger for other apps.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY not handling BLOBs
Date: 2004-08-04 18:43:40
Message-ID: 5184.1091645020@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

David Rysdam <drysdam(at)ll(dot)mit(dot)edu> writes:
> Doug McNaught wrote:
>> You might consider using "bytea" instead of large objects, unless you
>> need the lo_read()/lo_seek() API in your client app... I'm not

> bytea will only go up to "several thousand bytes" according to the
> docs.

[ raises eyebrow... ] According to *what* docs?

regards, tom lane


From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To:
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY not handling BLOBs
Date: 2004-08-04 18:49:03
Message-ID: 41112F9F.2030709@ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Tom Lane wrote:

>David Rysdam <drysdam(at)ll(dot)mit(dot)edu> writes:
>
>
>>Doug McNaught wrote:
>>
>>
>>>You might consider using "bytea" instead of large objects, unless you
>>>need the lo_read()/lo_seek() API in your client app... I'm not
>>>
>>>
>
>
>
>>bytea will only go up to "several thousand bytes" according to the
>>docs.
>>
>>
>
>[ raises eyebrow... ] According to *what* docs?
>
> regards, tom lane
>
>
>
>
I was using the general search feature and found something like that. I
only just now noticed that you can choose a doc version and search
within only that.


From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY not handling BLOBs
Date: 2004-08-08 03:48:11
Message-ID: 4115A27B.7010602@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 8/4/2004 1:58 PM, David Rysdam wrote:

> Doug McNaught wrote:
>
>>David Rysdam <drysdam(at)ll(dot)mit(dot)edu> writes:
>>
>>
>>
>>>Right now I'm having to write a program to create all the large
>>>objects up front and record the OIDs in a file which I will then COPY
>>>in with the rest of my data.
>>>
>>>
>>
>>You might consider using "bytea" instead of large objects, unless you
>>need the lo_read()/lo_seek() API in your client app... I'm not
>>super-familiar with how bytea and COPY work together, though.
>>
>>-Doug
>>
>>
> bytea will only go up to "several thousand bytes" according to the
> docs. I assume it's not very precise because the maximum is 8196 -
> $other_fields_in_row. My binary data could be a couple times that or
> even much bigger for other apps.

I suggest upgrading to PostgreSQL 7.1 or newer.

Jan

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #


From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY not handling BLOBs
Date: 2004-08-08 12:19:32
Message-ID: 87fz6xlt4b.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:

> On 8/4/2004 1:58 PM, David Rysdam wrote:
>
>> bytea will only go up to "several thousand bytes" according to the
>> docs. I assume it's not very precise because the maximum is 8196 -
>> $other_fields_in_row. My binary data could be a couple times that
>> or even much bigger for other apps.
>
> I suggest upgrading to PostgreSQL 7.1 or newer.

Or reading the right set of docs. :)

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863