X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 830F59DCAB7 for ; Fri, 9 Dec 2005 06:45:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47267-09 for ; Fri, 9 Dec 2005 06:45:44 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id E55019DCABD for ; Fri, 9 Dec 2005 06:45:39 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ekfje-0002qV-MI for pgsql-odbc@postgresql.org; Fri, 09 Dec 2005 11:44:18 +0100 Received: from 83.145.96.114 ([83.145.96.114]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Dec 2005 11:44:18 +0100 Received: from Marc.Herbert by 83.145.96.114 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Dec 2005 11:44:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-odbc@postgresql.org From: Marc Herbert Subject: Re: BLOB handling compatibility with PostgreSQL > 7.4 Date: Fri, 09 Dec 2005 11:46:01 +0100 Lines: 38 Message-ID: <87zmnah7km.fsf@meije.emic.fr> References: <438B792D.6030802@bnl.gov> <200512081055.12263.peter_e@gmx.net> <871x0nr8p0.fsf@meije.emic.fr> <200512081911.30002.peter_e@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.114 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:ycJJyhn0OqwXCWx7kr5eS7FMluY= X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.253 required=5 tests=[AWL=-0.000, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.253 X-Spam-Level: * X-Archive-Number: 200512/107 X-Sequence-Number: 6586 Peter Eisentraut writes: > Marc Herbert wrote: >> We are developping a middleware and are not free to choose our data >> types. > > I was thinking the ODBC driver should provide the appropriate mapping. We aim to be as transparent as possible and avoid "mappings". >> As far as i know, the implementation of bytea and large objects in >> the database are totally different and I suspect there are good >> reasons to use either one of them, depending on the actual data and >> application involved. > > There is no real reason to use large objects for anything instead of > bytea. PostgreSQL provides two distinct ways to store binary data. Binary data can be stored in a table using the data type bytea or by using the Large Object feature which stores the binary data in a separate table in a special format and refers to that table by storing a value of type oid in your table. In order to determine which method is appropriate you need to understand the limitations of each method.... Moreover, the respective interfaces have very different semantics (pointer or not). This can be a reason in itself to prefer one or the other type, whatever the underlying implementation is.