[postgis-devel] OGC Features ID

strk at refractions.net strk at refractions.net
Fri Mar 25 01:19:33 PST 2005


[ intentionally moved to geotool-devel only as for Jody proposal ]
[ postgis-devel included for obvious reasons ]

On Fri, Mar 25, 2005 at 03:24:49AM -0500, Chris Holmes wrote:
> FID stuff is super annoying, since all they say is that you have to have
> one, it has to be unique, and has to be persistant.  Different
> implementors do different things.  Leveraging primary keys when
> available to me is the most sensible solution.  But basically we try to
> deal with whatever the user may have set up in reasonable default ways,
> and then allow users control as much as possible in setting it up other
> ways.  The oid used to work great as the fid, since it was hidden for
> the most part.  Put Paul said it was going away in the future or
> something.

Oid is not a mandatory field:

	CREATE TABLE test (id serial) WITHOUT OIDS; 

In the future of postgresql the WITHOUT OIDS will be the default,
and users will have to explicitly request oids:

	CREATE TABLE test (id serial) WITH OIDS:

My suggestion is to consider *this* issue in the postgis side.
PostGIS has broader then OGC required feature, but OGC things
are done using OGC-specified function. One of this is
AddGeometryColumn(), which makes a table an OGC features table.

This function *might* ensure there's a primary key defined
for the table, being it either oid or 'gid' or whatever, and
eventually store this information in the geometry_columns
table. This would be yet another untracked dependency to be
aware of, which means users will easily break it, but could
be worth the effort.

--strk;



More information about the postgis-devel mailing list