Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-12 Thread Craig Ringer
On 02/12/2013 11:50 PM, Tom Lane wrote: > Craig Ringer writes: > >> It's my strong view that we should accept setString(...) for any >> string-like type, like xml, json, domains of text, and so on - or at >> least provide an easy, no-superuser-required way to tell Pg to do so. > > The difficulty

Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-12 Thread Tom Lane
Craig Ringer writes: > On 02/08/2013 12:55 PM, Tom Lane wrote: >> AFAIK this is just business as usual with JDBC: setString() implies that >> the parameter is of a string type. > Well, it means that it's a type compatible with a java.lang.String . > JDBC doesn't say much about the database-side t

Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-11 Thread Craig Ringer
On 02/08/2013 12:55 PM, Tom Lane wrote: > AFAIK this is just business as usual with JDBC: setString() implies that > the parameter is of a string type. Well, it means that it's a type compatible with a java.lang.String . JDBC doesn't say much about the database-side type. It's my strong view that

Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-09 Thread Vitalii Tymchyshyn
> This is not entirely unrelated to the discussions about allowing > broader use of automatic casting server-side. It seems to me that > on one side of the argument is the idea that strict typing reduces > bugs and doesn't lead to problems with ambiguity, especially as > things change; and on the

Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-08 Thread Kevin Grittner
Tom Lane wrote: >> when attempting to use a prepared statement: > >> ps = con.prepareStatement("insert into enumcast values (?)"); >> ps.setString(1, "meh"); >> ps.executeUpdate(); > >> we get a > >> org.postgresql.util.PSQLException: ERROR: column "current_mood" >> is of type mood bu

Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-07 Thread Tom Lane
Tom Dunstan writes: > ... That works ok, but when attempting to use a prepared statement: > ps = con.prepareStatement("insert into enumcast values (?)"); > ps.setString(1, "meh"); > ps.executeUpdate(); > we get a > org.postgresql.util.PSQLException: ERROR: column "current_mood" is o

Re: [HACKERS] [JDBC] JPA + enum == Exception

2013-02-07 Thread Tom Dunstan
> -Original Message- > From: pgsql-jdbc-ow...@postgresql.org > [mailto:pgsql-jdbc-ow...@postgresql.org] On Behalf Of Marc G. Fournier > I'm trying to use enum's in a database, but the java guys are telling me that > they are having problems with inserts ... > reading from the database isn