Обсуждение: ECPG and server datatypes vs client representations.

Поиск
Список
Период
Сортировка

ECPG and server datatypes vs client representations.

От
"Day, David"
Дата:

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