pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Euler Taveira <euler@timbira.com>
To: rmitchell@bzzagent.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7734: JPA2/Hibernate4 PG enum insert causes exception
Date: Mon, 10 Dec 2012 10:51:31 -0200
Message-ID: <50C5DAD3.2010606@timbira.com> (raw)
In-Reply-To: <E1TgLzQ-0003hz-Gg@wrigleys.postgresql.org>
References: <E1TgLzQ-0003hz-Gg@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 05-12-2012 18:54, rmitchell@bzzagent.com wrote:

[This is not a PostgreSQL bug. It seems a limitation/bug in Hibernate dialect.]

> insert into my_table (gender) values ('male');
> insert into my_table (gender) values ('female');
> insert into my_table (gender) values ('unknown');
> 
s/gender/gender_type/

> Caused by: org.postgresql.util.PSQLException: ERROR: column “gender_type” is
> of type GENDER_ENUM but expression is of type character varying
> Hint: You will need to rewrite or cast the expression.
> 
What is the SQL generated by Hibernate? It seems it is casting the expression
to varchar like:

insert into my_table (gender_type) values ('male'::varchar);


-- 
   Euler Taveira de Oliveira - Timbira       http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <50C5DAD3.2010606@timbira.com>
Permalink:  ../50C5DAD3.2010606@timbira.com/
Also on:    postgresql.org/message-id/50C5DAD3.2010606@timbira.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: euler@timbira.com, rmitchell@bzzagent.com
  Subject: Re: BUG #7734: JPA2/Hibernate4 PG enum insert causes exception
  In-Reply-To: <50C5DAD3.2010606@timbira.com>
  References: <E1TgLzQ-0003hz-Gg@wrigleys.postgresql.org> <50C5DAD3.2010606@timbira.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox