Search Postgresql Archives

ECPG and server datatypes vs client representations.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux