It doesn't matter what sort of PGobject it is, none of them work.
Here is an example:
PGobject pgo2 = new PGInterval();
f.insertInto(TEST, TEST.VAL)
.values(pgo2)
.execute();
Specifically I noticed this not working with any of the PostgreSQL geo
types, or the PostGIS geo types, or the HStore types.
Another interesting thing, the 'interval' type is detected by jOOQ (unlike
hstore, or geos)
TableField<TrackPositionRecord, Object> VAL = createField("val",
DefaultDataType.getDefaultDataType("interval"), this);
Then if I then cast the type...
PGobject pgo2 = new PGInterval();
f.insertInto(TEST, TEST.VAL)
.values(cast(pgo2.toString(), TEST.VAL))
.execute();
This works!
- Executing query : insert into "public"."track_position" ("val")
values (cast(? as interval))
- -> with bind values : insert into "public"."track_position" ("val")
values (cast('0 years 0 mons 0 days 0 hours 0 mins 0.00 secs' as interval))
But any other types remain undetected and are "USER-DEFINED" modifying this
string to "geometry" or "hstore" allows for these sort of dirty tricks.
Maybe you should consider the ability to pass in a string-type to cast so
that dirty tricks could be used?
.values(cast(pgo2.toString(), "interval"))
I haven't figured out how to pass these oddball types into Postgres as a
string otherwise, any time I send a geometry as a string it complains I'm
trying to cast the geom as a varchar type instead. :-/
On Sunday, February 24, 2013 1:10:48 PM UTC-5, Lukas Eder wrote:
>
> Can you show the source code that lead to this issue?
> Note, there is another thread about PostGIS support and how jOOQ
> doesn't yet fully support this...
>
> 2013/2/24 Peter Cooner <[email protected] <javascript:>>:
> > Using jOOQ 3 RC1
> >
> > I can select any PGobject from the database, but when I try to reinsert
> the
> > PGobject it fails saying:
> >
> > org.jooq.exception.SQLDialectNotSupportedException: Type class
> > org.postgresql.util.PGobject is not supported in dialect null
> > at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:640)
> > at org.jooq.impl.Factory.mostSpecific(Factory.java:6857)
> > at org.jooq.impl.Factory.val(Factory.java:6833)
> > at org.jooq.impl.Factory.val(Factory.java:6803)
> > at org.jooq.impl.Utils.field(Utils.java:441)
> > at
> org.jooq.impl.AbstractStoreQuery.addValue(AbstractStoreQuery.java:101)
> > at org.jooq.impl.InsertImpl.addValue(InsertImpl.java:284)
> > at org.jooq.impl.InsertImpl.values(InsertImpl.java:263)
> > at org.jooq.impl.InsertImpl.values(InsertImpl.java:147)
> > at org.jooq.impl.InsertImpl.values(InsertImpl.java:84)
> > at gis.Main.main(Main.java:89)
> > 337 [main] INFO gis.Main - End
> >
> >
> > Previously (2.6.X) this worked, but am I bumping into unsupported
> feature
> > land?
> >
> > --
> > Pete
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "jOOQ User Group" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to [email protected] <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.