From ddlutils-dev-return-1385-apmail-db-ddlutils-dev-archive=db.apache.org@db.apache.org Thu Mar 08 13:36:48 2007 Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 77129 invoked from network); 8 Mar 2007 13:36:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Mar 2007 13:36:45 -0000 Received: (qmail 35612 invoked by uid 500); 8 Mar 2007 13:36:54 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 35588 invoked by uid 500); 8 Mar 2007 13:36:54 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Received: (qmail 35577 invoked by uid 99); 8 Mar 2007 13:36:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2007 05:36:53 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2007 05:36:44 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4843971406B for ; Thu, 8 Mar 2007 05:36:24 -0800 (PST) Message-ID: <33165045.1173360984292.JavaMail.root@brutus> Date: Thu, 8 Mar 2007 05:36:24 -0800 (PST) From: "Richard Bounds (JIRA)" To: ddlutils-dev@db.apache.org Subject: [jira] Commented: (DDLUTILS-161) PostgreSQL Blob type mapping should be OID in v8 In-Reply-To: <7572862.1172750990905.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DDLUTILS-161?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479308 ]=20 Richard Bounds commented on DDLUTILS-161: ----------------------------------------- I'm actually using Hibernate to access the database, but I think the attach= ed unit test reproduces the problem more simply with plain JDBC - it create= s a table, inserts a row with a blob, copies the blob to a new row, then de= letes the table. When the table has a column of type OID, everything seems = fine. When it is BYTEA I get the following exception: org.postgresql.util.PSQLException: ERROR: column "photo" is of type bytea b= ut expression is of type integer =09at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx= ecutorImpl.java:1525) =09at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor= Impl.java:1309) =09at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.ja= va:188) =09at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stat= ement.java:452) =09at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(Abstract= Jdbc2Statement.java:354) =09at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdb= c2Statement.java:308) =09at TestPostgresBlob.testBlob(TestPostgresBlob.java:69) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at java.lang.reflect.Method.invoke(Method.java:585) =09at junit.framework.TestCase.runTest(TestCase.java:164) =09at junit.framework.TestCase.runBare(TestCase.java:130) =09at junit.framework.TestResult$1.protect(TestResult.java:106) =09at junit.framework.TestResult.runProtected(TestResult.java:124) =09at junit.framework.TestResult.run(TestResult.java:109) =09at junit.framework.TestCase.run(TestCase.java:120) =09at junit.framework.TestSuite.runTest(TestSuite.java:230) =09at junit.framework.TestSuite.run(TestSuite.java:225) For some reason I can reproduce this with either set of Drivers - I guess p= erhaps Hibernate is doing something to detect the V7 drivers. > PostgreSQL Blob type mapping should be OID in v8 > ------------------------------------------------ > > Key: DDLUTILS-161 > URL: https://issues.apache.org/jira/browse/DDLUTILS-161 > Project: DdlUtils > Issue Type: Bug > Components: Core - PostgreSql > Environment: PostgreSQL 8.1.8 on Fedora core 6 (i386). > Reporter: Richard Bounds > Assigned To: Thomas Dudziak > > For PostgreSQL v8 JDBC drivers the blob type maps to OID, not BYTEA: > from here: http://doc.postgresintl.com/jdbc/ch08.html > "....To use the Large Object functionality you can use either the LargeO= bject class provided by the PostgreSQL=E2=84=A2 JDBC driver, or by using th= e getBLOB() and setBLOB() methods...."=20 > When using PostgreSQL (v7 or v8) with the v7 JDBC drivers BYTEA works fin= e, but with the v8 drivers you get an error message: > ERROR: column "binvalue" is of type bytea but expression is of type oid --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.