[Gdal-dev] PostGis layers

Charles F. I. Savage cfis at interserv.com
Thu Sep 22 15:10:52 EDT 2005


Hi everyone - working with OGR and PostGis.

When OGR opens a Postgis enabled database, it finds its layers via this 
query (I added the select g.f_table_name part to show a problem below):

SELECT c.relname, g.f_table_name FROM pg_class c, geometry_columns g
WHERE (c.relkind in ('r','v') AND c.relname !~ '^pg'
AND c.relname ~ g.f_table_name)

I've pasted the results of this query below.  Note that the 
polygoncorrections and polgyoneconomics layer show up twice!  This is 
caused by this part of the query:

AND c.relname ~ g.f_table_name)

Shouldn't it be a direct match without a regular expression, like this:

AND c.relname = g.f_table_name)


Charlie


"altname";"altname"
"arealandmarks";"arealandmarks"
"arealandmarks";"landmarks"
"completechain";"completechain"
"entitynames";"entitynames"
"featureids";"featureids"
"idhistory";"idhistory"
"landmarks";"landmarks"
"overunder";"overunder"
"pip";"pip"
"polychainlink";"polychainlink"
"polygon";"polygon"
"polygoncorrections";"polygon"
"polygoncorrections";"polygoncorrections"
"polygoneconomic";"polygon"
"polygoneconomic";"polygoneconomic"
"tlidrange";"tlidrange"
"zerocellid";"zerocellid"
"zipcodes";"zipcodes"
"zipplus4";"zipplus4"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2781 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20050922/558b1050/smime.bin


More information about the Gdal-dev mailing list