Why does this function, pg_convert(), reject the string 'TRUE' as a valid value for the boolean types? I'm using PHP 4.3.9 and my web page originally set the value for submission to update, to 'TRUE'. pg_convert() threw it back to me saying that it's not a valid value for boolean types. However, the postgresql website says otherwise. See http://www.postgresql.org/docs/7.4/static/datatype-boolean.html for the context of my question/comment.
pg_convert
(PHP 4 >= 4.3.0, PHP 5)
pg_convert — Converte os valores de um array associativo em uma declaração SQL apropriada.
Descrição
pg_convert() checa e converte assoc_array em uma declaração SQL apropriada. Pré-condição para pg_convert() é a existencia de uma tabela table_name a qual teve ter tantos campos quantos os elementos em assoc_array. Os nomes dos campos em e os valores em table_name devem ser iguais aos índices e valores em assoc_array. Retorna uma matriz com os valores convertidos em caso de sucesso ou se não, FALSE.
Esta função é EXPERIMENTAL. O comportamento desta função, seu nome, incluindo toda documentação pode ser modificado sem aviso em futuras versões do PHP. Esta função deve ser usada por sua própria conta e risco.
Veja também pg_meta_data().
pg_convert
24-Feb-2005 12:03
The only options that I see are:
PGSQL_CONV_IGNORE_DEFAULT - Do not use DEAFULT value by removing field from returned array
PGSQL_CONV_FORCE_NULL - Convert to NULL if string is null string
PGSQL_CONV_IGNORE_NOT_NULL - Ignore NOT NULL constraints
These are constants, so don't quote them or anything.
12-May-2003 06:28
I've found "options" possible values:
PG_CONV_CHECK - check only
PG_CONV_STRICT - raise warning for non fatal error
PG_CONV_QUOTE - add quote around values for vchar, text datetime.
PG_CONV_SLASH - add slashes if it needed.
PG_CONV_NULLCHK - check values are defined for NOT NULL fields.
PG_CONV_NO_DEFAULT - ignore default value even if value is empty string.
