473,466 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

COPY not handling BLOBs

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.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #1
4 1447
David Rysdam <dr*****@ll.mit.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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2
Tom Lane wrote:
David Rysdam <dr*****@ll.mit.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.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3
On 8/4/2004 1:58 PM, David Rysdam wrote:
Doug McNaught wrote:
David Rysdam <dr*****@ll.mit.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. #
#================================================= = Ja******@Yahoo.com #

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4
Jan Wieck <Ja******@Yahoo.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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kirby Urner | last post by:
I've been testing the Cookbook example 8.6 (2002 edition) re using cPickle to insert and retrieve BLOBs from mySQL, using Python's MySQLdb module. When I try to cPickle.loads(blob), I get an...
0
by: Ole Hansen | last post by:
Hi, I have a working application inserting rows to a table using the array interface. Now I want to insert BLOBs as well but OCIStmtExecute crashes when executed with BLOBs. For BLOB types I...
0
by: Ole Hansen | last post by:
Hi, Is it at all possible to insert BLOBs using the Array Interface? Today I have an application using the array interface. It works fine but so far I haven't been using BLOBs. I insert...
7
by: Howard Lowndes | last post by:
My situation is that I am interacting PHP 4.1.2 to PostgreSQL 7.2.2 I have no difficulty inserting and managing BLOBs into the Large Object system table, and I have a user table called images...
7
by: Nilabhra Banerjee | last post by:
Hi, I am still not sure whether the BLOBS are actually stored in the database or they have the pointer to the database for that file in the filesystem. If I remove the files (sources) for BLOBS...
0
by: Bing | last post by:
Hi there, I am using the DB2 universal JDBC driver type 4 to insert BLOBs into a DB2 database. The Method I used for supplying the BLOB data value is setBinaryStream(). Everything works fine as...
2
by: Jerry LeVan | last post by:
Hi, I am just getting into large objects and bytea "stuff". I created a small db called pictures and loaded some large objects and then tried to do a restore. Here is how I got the dump. ...
2
by: Mikael | last post by:
I have a database made up of students' profiles. I would like the form to have an object that displays the student's picture. I used to use gifs and ole object fields, but I recently switched to...
1
by: nordy | last post by:
Hi, I have these tables with binary data stored in tinyblobs and blobs in MySql. In my application I sometimes need to copy them to another table. Not all the data, maybe just a column or two. So...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.