Mapinfo error when accessing PostGIS table.

626 views
Skip to first unread message

mi...@liondc.com

unread,
Sep 13, 2011, 8:09:04 PM9/13/11
to MapInfo-L
Hi There,

I have read through the previous posts regarding PostGIS and cannot
find a solution, so I am hoping someone can help me here.

I am running MIP10.5, PostgreSQL9.1 and PostGIS2.0

I created a new database using the 'template_postgis20' database as a
template and called the database LPI.

I created an ODBC connection to the LPI database without issue.

I then opened the MapInfo EasiLoader tool and created a Map Catalogue.
I selected my file (in options it showed as being a PostGIS spatial
file) and uploaded it to the public schema.

When I try and open the associated TAB file (GAP_Bridges_srv.TAB) I
get the following error:

ODBC Error: ODBC RC=-1, ODBC SQLState=0A000, DBMS RC=7, DBMS
Msg=ERROR: cross-database references are not implemented:
"lpi.public.gap_bridges;
Error while executing the query. Unable to open table GAP_Bridges_srv.

Alternatively, when I Open a DBMS connection in MapInfo and try to
directly access the table I get the following error:

ODBC Error: ODBC SQLState=42703, DBMS RC=7 DBMS Msg=ERROR: column
"oid" does not exist;
Error while executing the query.

I have checked the mapinfo_mapcatalog table in the mapinfo schema of
the LPI database and it has a line entry for the GAP_Bridges
tablename. The fields are:

19;"GAP_Bridges";"public";"SP_GEOMETRY";
541329.350788;6118001.519576;579329.579408;6164965.224983;552484.341187;6140654.948547;553900.079569;6142930.500371;"Earth
Projection 8, 33, "m", 147, 0, 0.9996, 500000, 10000000 Bounds
(520225, 6112400) (594398, 6183486)";"Symbol (79,16711680,12,"MapInfo
Cartographic",257,0) ";"NO_COLUMN";"NO_COLUMN";1;"MI_STYLE";"''";

ALSO, the mapinfo_mapcatalog table properties are below.

Name mapinfo_mapcatalog
OID 17584
Owner postgres
Tablespace pg_default
ACL {postgres=arwdDxt/postgres,=arwd/postgres}
Of type
Primary key <no primary key>
Rows (estimated) 0
Fill factor
Rows (counted) 6
Inherits tables No
Inherited tables count 0
Unlogged? No
Has OIDs? No
System table? No
Comment

Hope someone can help. Please assume a 'beginner level' PostGIS user
when replying.

Thanks

Mick

Bo Victor Thomsen

unread,
Sep 14, 2011, 3:35:28 AM9/14/11
to mapi...@googlegroups.com
To Mick -

Your table is probably named with a mixed case name like "GAP_Bridges".

You can try the following:
  1. Open the tab file with a text editor (notepad, ultraedit..) and search for the database table name.
  2. Enclose the table name with citation signs (""). Remember to use double citation signs if the tablename is inside a character string. Ex. "Select * from lpi.public.GAP_Bridges" becomes "Select * from lpi.public.""GAP_Bridges""".
Alternatively you can rename your mixed case named table to all lower case in the database. If you do this, you have to alter the corresponding entries in the mapinfo.mapinfo_ mapcatalog table and the public.geometry_columns table and possibly the table name in the aforementioned tab-file.

In Postgresql, it's generally a good idea to have all table- and field names with "only lower case" names. Otherwise you have to enclose the "mixed case " table and field names with citation signs in every sql statement.

Regards
Bo Victor Thomsen
Aestas
Denmark

Quentin

unread,
Sep 14, 2011, 2:37:11 PM9/14/11
to MapInfo-L
Hi,

Which version of the PostGIS ODBC-driver do you use? MIP 10.5 does
only support up to 8.something not those starting with 9, have givin
me some strange errors before.

Best regards
Ulrik
Reply all
Reply to author
Forward
0 new messages