ECPG and server datatypes vs client representations. - Mailing list pgsql-general

From Day, David
Subject ECPG and server datatypes vs client representations.
Date
Msg-id 401084E5E73F4241A44F3C9E6FD7942808190D2A@exch-01.redcom.com
Whole thread Raw
List pgsql-general

Hi,

 

I have an embedded application retrieving data from a postgres database using the  ECPG client interface.   One process acts as an intermediary for other tasks for r/w  operations. 

 

When the the pg interface task retrieves a row into a sql descriptor and inspects the column types for a declared  Boolean  field,   The Client is given a string type with data value of  ‘t’/’f’.  Why is it  (ECPGt_char)  rather then ECPGt_bool ?

Very human friendly but I have a machine making decisions.

If I pass this column/data  along as strings the other tasks are left to do less efficient comparisons to ‘t’ or ‘f’  to asses a flag. 

 

I suppose I could declare it an int column with a range of 1 or 0.

 

Is there anything more elegant ?

 

I am new to database programming and postgres.

( Any good postgres programming best practice guides out there ? )

 

 

Tnx

 

 

Dave

pgsql-general by date:

Previous
From: tv@fuzzy.cz
Date:
Subject: Re: Write performance on a large database
Next
From: Tom Lane
Date:
Subject: Re: plpgsql function with update and seeing changed data from outside during run