[GRASS5] Re: [GRASSLIST:2433] Re: pg driver and boolean columns (v.in.db, v.out.ogr)

Radim Blazek blazek at itc.it
Tue Feb 10 12:19:05 EST 2004


On Monday 02 February 2004 11:15, Radim Blazek wrote:
> On Sunday 01 February 2004 15:58, David Orme wrote:
> > Hi,
> >
> > I've just been using v.in.db to register points from a PostgreSQL table
> > - it all works nicely except that the pg driver doesn't support
> > converting boolean columns in my pg table into the resulting dbf file
> > (see below for output of v.in.db). This isn't a huge problem because I
> > can just use v.db.connect to connect the vector map back to the
> > original pg table, but v.out.ogr also is unable to export these columns
> > through the pg driver.
>
> Boolean is not supported by DBMI (DB library in GRASS) and DBF driver.
> It is easy to convert boolean to any supported type, but which one?
> integer : 0/1
> char(1) : 0/1
> char(1) : y/n
> char(1) : t/f

I have added:
bool (boolean) -> char(1): '0', '1'
text -> varchar(250)

Currently supported types (Postgres):
int2, smallint, int4, int, integer, int8, bigint, serial, oid
float4, real, float8, double precision, numeric, decimal
character, char, character varying, varchar,  text, bool, boolean
date, time, timestamp

Radim




More information about the grass-dev mailing list