Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ti2q5-0007AU-1x for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Dec 2012 12:52:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ti2q4-0004sg-5v for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Dec 2012 12:52:04 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ti2q3-0004sa-6N for pgsql-bugs@postgresql.org; Mon, 10 Dec 2012 12:52:03 +0000 Received: from oproxy9.bluehost.com ([69.89.24.6]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ti2pz-0000ZD-EC for pgsql-bugs@postgresql.org; Mon, 10 Dec 2012 12:52:02 +0000 Received: (qmail 7379 invoked by uid 0); 10 Dec 2012 12:51:34 -0000 Received: from unknown (HELO host159.hostmonster.com) (74.220.207.159) by oproxy9.bluehost.com with SMTP; 10 Dec 2012 12:51:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=timbira.com; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=jq+NfB1OQPSXAMhz7H+Zs8Um+w1KieBf5BQqjl8riFk=; b=uRP2Rs9X+Zel7xdcRISPO1H+JoZKgxt31cJpRfvhrmBU9CsZQYvSZYxZ9k+AhgzDaghQe2D5P84py6MGacac1W78To1uhIm4Q6Cabd7Gy0abgAFq6GFf99tquLFLODfR; Received: from [189.10.73.128] (port=61403 helo=[10.3.2.3]) by host159.hostmonster.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76) (envelope-from ) id 1Ti2pZ-0002GU-Oa; Mon, 10 Dec 2012 05:51:34 -0700 Message-ID: <50C5DAD3.2010606@timbira.com> Date: Mon, 10 Dec 2012 10:51:31 -0200 From: Euler Taveira User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121027 Icedove/10.0.10 MIME-Version: 1.0 To: rmitchell@bzzagent.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7734: JPA2/Hibernate4 PG enum insert causes exception References: In-Reply-To: X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Identified-User: {1651:host159.hostmonster.com:timbirac:timbira.com} {sentby:smtp auth 189.10.73.128 authed with euler@timbira.com} X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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