#include "wkbtest.h" /* example set-up create table wkbreader_test (interesting bool,comments varchar(100), the_geom geometry); insert into wkbreader_test values ( false, 'simple point', 'POINT( 10 10)' ); insert into wkbreader_test values ( false, 'simple line' , 'LINESTRING(0 0, 10 0, 10 10, 0 10, 0 0)'); insert into wkbreader_test values( true, 'polygon w/ hole','POLYGON( (0 0, 10 0, 10 10, 0 10, 0 0), (5 5, 7 5, 7 7 , 5 7 , 5 5))'); dont forget to set the port, dbname, host, and user in the environment so the postgres connection will work Also, change the "declare cursor" command so it returns the columns you want, and converts the geometry into wkb. */ void exit_nicely(PGconn *conn) { PQfinish(conn); exit(1); } void dump_bytes( char *a, int numb) { int t; for (t=0; t