[Oledb-dev] geometry-type

Shachar Shemesh psql at shemesh.biz
Wed May 11 09:13:18 GMT 2005


Uwe Seher wrote:

>Hello group!
>
>I have a question about geometry-columns. I am developing a connecton
>between postgis and arcmap with pgoledb and ado. Now i have the following
>problem:
>When i tryto load a postgistable (created from a shapefile) i get this
>errormessage
>
>-2147467259, PgOleDb: ERROR:  no binary output function available for type
>geometry
>
>  
>
OleDb, and accordingly, PgOleDb, is a binary interface driver. As such, 
it gets all data types in binary form from the database. In order for a 
datatype to be supported, two conditions must be satisfied:
1. The data type must have a binary output function defined in PG itself.
2. PgOleDb must know how to handle this type, to translate it to the 
binary interface OLE DB is expected to return said type.

>So i think, this means that the pgoledb-driver can not transport the
>geometry-field type.
>  
>
Up until your email, most complaints about insufficient support were for 
problems in 2. Congratulation! You are the first to stumble upon 1! The 
error you see was produced by the database back end.

In other words - most probably PgOleDb cannot transport the 
geometry-field type, but more importantly, Postgres cannot transport the 
geometry-field type in binary form. The first order of business is 
getting that resolved, and only then can we actually handle the type in 
PgOleDb.

Personally, I know nothing about postgis. I don't know what data types 
are used there, what their OIDs are, and how they should be handled. You 
can help, however. When you do this query with other databases, what do 
you expect to get back? A textual field? An array of numbers in binary?

Also, a couple of words about PostGIS would be welcome. What is it? Who 
maintains it? Does it have fixed OIDs for types?

In general, PgOleDb has all the infrastructure needed to handle this 
request, but more information is required before actual code can be written.

>Now my qustion:
>How can i get arround this problem? Are there some workarounds? Has someone
>experience in the topic? Maybe is it solved in nearer times?
>  
>
You can cast the information to another form. For example, you can replace:
"select geom from table" with "select geom::text from table". This will 
cause Postgres to cast the geometry field to a text field, which PgOleDb 
knows how to get. I would really appreciate, however, an answer to the 
above questions, so we can get a more permanent solution into the system.

>Sorry, 4 questions, but the same topic ;)
>
>Thank you all
>
>Uwe Seher
>  
>
       Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html



More information about the Oledb-devel mailing list