c - string to Numeric/Date in PostgreSQL -
i have string
numeric
/date
value in it. need convert string applynumericgetdatum()
/dateadtgetdatum
function respectively. how go it?i looked to_char() function, but, wouldn't know format convert (how many digits/date format).
when query
information_schema.columns
table know datatype of column, valuenumeric
. postgresql mentions in table http://www.postgresql.org/docs/9.1/static/datatype-numeric.html#datatype-numeric-table, differentnumeric
types available. why doesn't query return 1 of types, instead ofnumeric
?
thanks!
most types have own file in
src/backend/utils/adt/
containing variety of supporting functions. string conversion routinenumeric
, insrc/backend/utils/adt/numeric.c
, callednumeric_in()
(likewisedate
). search postgres codebase examples of how these functions called.there many different types representing numbers (i.e. "numeric types"). 1 of these types called
numeric
(it appears in table linked to).
Comments
Post a Comment