Re: bytea etc.

From: Joe Conway <mail(at)joeconway(dot)com>
To: Andrew Klimov <and_k_98(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: bytea etc.
Date: 2002-08-22 15:32:31
Message-ID: 3D65040F.7010201@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Andrew Klimov wrote:
> When I want to store BLOB's internally in database (for example jpeg )
> should I use bytea or OID? Is OID something like BFILE in Oracle 8i?

Bytea is a "normal" data type, stored in-line similar to text (it can
actually be stored in an external toast table, but that's transparent to
the user), whereas the large object interface has its own special access
functions and maintains file-oriented access. See:
http://www.postgresql.org/idocs/index.php?largeobjects.html
for more info on large objects.

> If both are appropriate for internal BLOB why I can't use
>
> update image set picture=lo_import('Myfile') where image_code='blablabla' ;
> with bytea column type but only with OID column type?

See above. The two are different.

> And one more thing:
> Where is function byteain documented?

It's not, because you should never use it directly. You really need to
spend some time reading the documentation. See:
http://www.postgresql.org/idocs/index.php?datatype-binary.html
for more info on bytea, and:
http://www.postgresql.org/idocs/index.php?functions-binarystring.html
for info on bytea specific functions.

Joe

In response to

  • bytea etc. at 2002-08-22 13:34:16 from Andrew Klimov

Browse pgsql-sql by date

  From Date Subject
Next Message imtiaz sm 2002-08-22 16:26:57 Re: BITMAP INDEXES...
Previous Message Bruce Momjian 2002-08-22 14:30:39 Re: BITMAP INDEXES...