-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: PostgreSQL Dialect returns an OID for Types.BLOB??? Huh?
PostPosted: Thu Mar 31, 2005 1:47 am 
Beginner
Beginner

Joined: Sat Sep 25, 2004 12:42 am
Posts: 27
Hibernate version:
Hibernate 3 RC1

Name and version of the database you are using:
PostgreSQL 8

org.hibernate.dialect.PostgreSQLDialect returns "oid" for Types.BLOB. According to the PostgreSQL docs, OID types are used internally by PostgreSQL as primary keys. It should return "bytea" as net.sf.hibernate.dialect.PostgreSQLDialect does... I'll log a Jira issue...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 1:56 am 
Beginner
Beginner

Joined: Sat Sep 25, 2004 12:42 am
Posts: 27
This issue seems to indicate that it should be working but the source still returns "oid". It was working in Hibernate 2.x and I don't really follow the reason for the change to "oid" change.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 2:05 am 
Beginner
Beginner

Joined: Sat Sep 25, 2004 12:42 am
Posts: 27
This is made evident by using the org.hibernate.tool.hbm2ddl.SchemaExport class. The generated DDL contains columns with a type of OID that should (I think) be "bytea".


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 2:44 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Both are valid for postgresql BLOBS, http://www.postgresql.org/files/documen ... ode96.html


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 3:17 am 
Beginner
Beginner

Joined: Sat Sep 25, 2004 12:42 am
Posts: 27
Interesting... when I use the column type "bytea" everything works fine, if I change it to "oid" i get the following error...

15:24:45.976 [WARN] [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 0, SQLState: 22P02
15:24:45.976 [ERROR] [org.hibernate.util.JDBCExceptionReporter] - ERROR: invalid input syntax for type oid:...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 8:25 pm 
Beginner
Beginner

Joined: Sat Sep 25, 2004 12:42 am
Posts: 27
Maybe it doesn't work with PostgreSQL 8...

If I follow the instructions mentioned on the castor page and add "compatible=7.1" to my jdbc connection URL the OID stuff works... that doesn't seem right to me... Maybe the current PostgeSQL dialect hasn't been tested with PostgreSQL 8.x?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 01, 2005 3:48 am 
Beginner
Beginner

Joined: Sat Sep 25, 2004 12:42 am
Posts: 27
I take it all back. Nothing wrong with BLOBs using Hibernate3 and PostgreSQL...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.