agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Eugene Yin <eugeneymail@ymail.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: BYTEA vs BLOB
Date: Wed, 13 Jan 2016 01:45:06 +0000 (UTC)
Message-ID: <1001118704.4351476.1452649506915.JavaMail.yahoo@mail.yahoo.com> (raw)
References: <1001118704.4351476.1452649506915.JavaMail.yahoo.ref@mail.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Try to migrate from Oracle to Postgres (9.4.5) on Linux OS.
I have some photos stored in a table, to make it simple, the current (Oracle) table looks like:
test_tab (photo BLOB)LOB ("photo") store as BASICFILE (tablespace "MYLOB" disable storage in row...
That disable storage in row will only allow a reference to be stored in the table while the actual BLOB data is stored outside the table, still inside the Oracle database, though (just NOT in the computer's file system).  When issue the delete from test_tab where id= 12345 lateron, the BLOB data will also get deleted, even if the BLOB value was stored out of the row at the first place.

Now if I migrate the Oracle table to Postgres and change the data type to BYTEA, how will the photo file (BYTEA) be stored?
1) The whole photo data will be stored inside the table?
Or
2) Only the reference to the data is stored inside the table, the data itself will be stored outside the table (but still within the database) for efficiency purpose?


Thanks to help.
Eugene

view thread (8+ messages)  latest in thread

Message-ID: <1001118704.4351476.1452649506915.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../1001118704.4351476.1452649506915.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/1001118704.4351476.1452649506915.JavaMail.yahoo@mail.yahoo.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eugeneymail@ymail.com
  Subject: Re: BYTEA vs BLOB
  In-Reply-To: <1001118704.4351476.1452649506915.JavaMail.yahoo@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox