|
From: Peter F. <pfa...@in...> - 2006-05-16 21:00:37
|
Thanks for the response.
By the way, I can't get ConnectionTester to recognize schemas other than
"public". I set the connection.properties file entries to include
Schema=MySchema
(which seems to be undocumented). It then finds the types (tables) in the
schema, then calls ds.getFeatureSource()
Which eventually gets down the stack to
PostgisDataStore(JDBC1DataStore).buildFIDMapper() which has the line:
FIDMapper mapper = factory.getMapper(null, null, typeName, conn);
This passes catalog and schema as NULL, meaning that everything below
PostgisDataStore uses the default schema, not the schema that was
configured.
Am I misunderstanding what's going on here?
Regards,
Peter
Here's the stack:
PostgisFIDMapperFactory(DefaultFIDMapperFactory).getPkColumnInfo(String,
String, String, Connection) line: 292
PostgisFIDMapperFactory(DefaultFIDMapperFactory).getMapper(String, String,
String, Connection) line: 95
PostgisDataStore(JDBC1DataStore).buildFIDMapper(String, FIDMapperFactory)
line: 1037
FeatureTypeHandler.getFIDMapper(String) line: 234
PostgisDataStore.getFeatureSource(String) line: 1430
ConnectionTester.main(String[]) line: 68
-----Original Message-----
From: geo...@li...
[mailto:geo...@li...] On Behalf Of Chris
Holmes
Sent: Tuesday, May 16, 2006 4:02 PM
To: pfa...@in...
Cc: geo...@li...
Subject: Re: [Geotools-gt2-users] FeatureCollection expecting deprecated
'OID' column in DataStore for PostgreSQL -
I believe if you declare a primary key on your data then GeoTools will
not default to oid's. It only uses those as the last possible default.
If you've declared serials like they recommend, then just change
those to be the primary key. We probably need a better error, but if
there's a primary key then it should be picked up.
Chris
Peter Fay wrote:
> Hi Folks,
>
> Newbie to GeoTools.
>
> I ran the ConnectionTester program:
> http://docs.codehaus.org/display/GEOTOOLS/ConnectionTester
>
> It got an exception in ConnectionTester.showData() because
FeatureCollection
> is creating a SQL statement to select on a column named 'OID'. OIDs have
> been deprecated as of PostgreSQL 8.1:
>
>
http://www.postgresql.org/docs/8.1/interactive/runtime-config-compatible.htm
> l#GUC-DEFAULT-WITH-OIDS
>
>
> The Postgres documentation suggests using SERIAL columns instead when
> uniqueness is needed:
> http://www.postgresql.org/docs/8.1/interactive/release-8-1.html:
>
>
> "default_with_oids is now false by default (Neil)
>
> "With this option set to false, user-created tables no longer have an OID
> column unless WITH OIDS is specified in CREATE TABLE. Though OIDs have
> existed in all releases of PostgreSQL, their use is limited because they
are
> only four bytes long and the counter is shared across all installed
> databases. The preferred way of uniquely identifying rows is via sequences
> and the SERIAL type, which have been supported since PostgreSQL 6.4."
>
>
> Is there a fix for GeoTools for this? Are OIDs necessary for GeoTools for
> some reason? Do I have to recreate all my tables with OIDs? (Do I pull my
> hair out or what?)
>
> Regards,
> Peter Fay
> www.intelliskills.com
>
>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Geotools-gt2-users mailing list
> Geo...@li...
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
|