bytea or large objects?

Started by Howard Coleover 20 years ago5 messagesgeneral
Jump to latest
#1Howard Cole
howardnews@selestial.com

Hi,

I am going to create binary objects in a database which are compressed
eml files (1K - 10 Mbytes in size). Am I better using the bytea or large
objects?

Is there still an issue with backup and restore of databases using large
objects with pg_dump/restore?

Thanks in advance.
Howard Cole
www.selestial.com

#2Peter Wilson
petew@yellowhawk.co.uk
In reply to: Howard Cole (#1)
Re: bytea or large objects?

Howard Cole wrote:

Hi,

I am going to create binary objects in a database which are compressed
eml files (1K - 10 Mbytes in size). Am I better using the bytea or large
objects?

Is there still an issue with backup and restore of databases using large
objects with pg_dump/restore?

Thanks in advance.
Howard Cole
www.selestial.com

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

I've just re-written our Whitebeam code to drop large-objects in favour of BYTEA fields.

All the old problems of large objects in backups exist, but the killer for us was that none of the current replication systems, at least that I could
find, would replicate large objects. This became a mandatory requirements for us.

I'd have to have a *very* good reason to use large objects over BYTEA now.

Pete
--
http://www.whitebeam.org
http://www.yellowhawk.co.uk
-----

#3Joshua D. Drake
jd@commandprompt.com
In reply to: Peter Wilson (#2)
Re: bytea or large objects?

I've just re-written our Whitebeam code to drop large-objects in favour
of BYTEA fields.

All the old problems of large objects in backups exist, but the killer
for us was that none of the current replication systems, at least that I
could find, would replicate large objects. This became a mandatory
requirements for us.

Mammoth Replicator has always replicated Large Objects. The only
"backup" issue to large objects is that you have to pass a separate flag
and use the custom or tar format to dump them.

Bytea has its own issues mostly based around memory usage.

I am not saying you should or shouldn't switch as it really depends on
your needs but the information above just isn't quite accurate.

Sincerely,

Joshua D. Drake

I'd have to have a *very* good reason to use large objects over BYTEA now.

Pete
--
http://www.whitebeam.org
http://www.yellowhawk.co.uk
-----

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

--
Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240
PostgreSQL Replication, Consulting, Custom Programming, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

#4Peter Wilson
petew@yellowhawk.co.uk
In reply to: Joshua D. Drake (#3)
Re: bytea or large objects?

Joshua D. Drake wrote:

I've just re-written our Whitebeam code to drop large-objects in
favour of BYTEA fields.

All the old problems of large objects in backups exist, but the killer
for us was that none of the current replication systems, at least that
I could find, would replicate large objects. This became a mandatory
requirements for us.

Mammoth Replicator has always replicated Large Objects. The only
"backup" issue to large objects is that you have to pass a separate flag
and use the custom or tar format to dump them.

Bytea has its own issues mostly based around memory usage.

I am not saying you should or shouldn't switch as it really depends on
your needs but the information above just isn't quite accurate.

Sincerely,

Joshua D. Drake

I should have added that my search was limited to open source/free replication
systems.

Show quoted text

I'd have to have a *very* good reason to use large objects over BYTEA
now.

Pete
--
http://www.whitebeam.org
http://www.yellowhawk.co.uk
-----

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

#5Howard Cole
howardnews@selestial.com
In reply to: Peter Wilson (#4)
Re: bytea or large objects?

Peter Wilson wrote:

Joshua D. Drake wrote:

I've just re-written our Whitebeam code to drop large-objects in
favour of BYTEA fields.

All the old problems of large objects in backups exist, but the
killer for us was that none of the current replication systems, at
least that I could find, would replicate large objects. This became
a mandatory requirements for us.

Mammoth Replicator has always replicated Large Objects. The only
"backup" issue to large objects is that you have to pass a separate flag
and use the custom or tar format to dump them.

Bytea has its own issues mostly based around memory usage.

I am not saying you should or shouldn't switch as it really depends
on your needs but the information above just isn't quite accurate.

Sincerely,

Joshua D. Drake

Thanks Peter, Joshua,

On this information I will probably opt for BYTEA. I do not use
replication but aim to in the future, and would like to keep as many
options open as possible. The memory problem of large BYTEA arrays does
bother me. It would be nice to be able to open these types as file
streams like the large object type and get the best of both worlds. Is
this feasible?

Best regards,
Howard Cole
www.selestial.com

Show quoted text

I should have added that my search was limited to open source/free
replication
systems.

I'd have to have a *very* good reason to use large objects over
BYTEA now.

Pete
--
http://www.whitebeam.org
http://www.yellowhawk.co.uk
-----

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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq