Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7A1DB47603F for ; Thu, 22 Aug 2002 11:33:17 -0400 (EDT) Received: from joeconway.com (unknown [63.210.180.150]) by postgresql.org (Postfix) with ESMTP id 93DFD47603B for ; Thu, 22 Aug 2002 11:33:16 -0400 (EDT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 3.5.9) with ESMTP-TLS id 1310835; Thu, 22 Aug 2002 08:20:43 -0700 Message-ID: <3D65040F.7010201@joeconway.com> Date: Thu, 22 Aug 2002 08:32:31 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Klimov Cc: pgsql-sql@postgresql.org Subject: Re: bytea etc. References: <20020822133416.86495.qmail@web20417.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/314 X-Sequence-Number: 9160 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