Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id ADEA46334BC for ; Sat, 23 May 2009 11:02:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 53324-05 for ; Sat, 23 May 2009 11:02:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f174.google.com (mail-fx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id EB75E63317E for ; Sat, 23 May 2009 11:02:15 -0300 (ADT) Received: by fxm22 with SMTP id 22so2367243fxm.19 for ; Sat, 23 May 2009 07:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=hO+Inzt2tKAcoN8mA6+jJ5HJUk2bKlfMRSNImsACqhs=; b=ez26LuXP/ArjTaPrrzmvLR1E/Ugziif4Kt9U9Uct/fIkyjEhAO9vlKGC45HytXk8hP O9/ApXb7Hz9VXo7ZS9fiJoLNJVnjtqHDeU1SiYfErP97o5wA/CqnSSBUIbLNxOu02BCo 09EA0WApsgydX7cbh0NvYt8istzZs9BMhocIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=YUeAAmG/V10LwCiDRODVQ7y9h+uwWIUwjYGzbsIBqlk5wL/C3rqaaTFqtVQZYRpJbL UIBWddCyna/3YNBAgAtxfn5p8jMwGWBf0NZvNL0e3swL5Cy2Rg2xdcDtVmntc0kq2Cm9 WAFeHCTJ9ZLpHT9a34lJuhsI2Nnl0SGzBq3js= MIME-Version: 1.0 Received: by 10.103.168.12 with SMTP id v12mr2583501muo.45.1243087333285; Sat, 23 May 2009 07:02:13 -0700 (PDT) Date: Sat, 23 May 2009 15:02:12 +0100 Message-ID: <548aeab30905230702x1e7d0620nb3686c49bf889a68@mail.gmail.com> Subject: Java persistence with enum types From: Susannah Relf To: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016367ed508ecfb91046a94d226 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200905/95 X-Sequence-Number: 19645 --0016367ed508ecfb91046a94d226 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, I have an enum type in my postgres 8.3 database: CREATE TYPE typeOfNames AS ENUM ('Latin', 'Common', 'Local'); I am trying to access the database through the Java Persistence API using Netbeans: @Lob @Column(name = "typeofname") private String typeofname; This works for reading from the database, but writing to it, I get the error message: Caused by: org.postgresql.util.PSQLException: ERROR: column "typeofname" is of type typeofnames but expression is of type character varying Anyone got any suggestions? Thanks --0016367ed508ecfb91046a94d226 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, I have an enum type in my postgres 8.3 database:

CREATE TYPE typ= eOfNames AS ENUM ('Latin', 'Common', 'Local');
<= br>I am trying to access the database through the Java Persistence API usin= g Netbeans:
=A0=A0=A0 @Lob
=A0=A0=A0 @Column(name =3D "typeofname")
=A0= =A0=A0 private String typeofname;

This works for reading from the da= tabase, but writing to it, I get the error message:
Caused by: org.postg= resql.util.PSQLException: ERROR: column "typeofname" is of type t= ypeofnames but expression is of type character varying

Anyone got any suggestions?

Thanks



--0016367ed508ecfb91046a94d226--