Proposal for Clean-up of Conversion Functions
От | Josh Berkus |
---|---|
Тема | Proposal for Clean-up of Conversion Functions |
Дата | |
Msg-id | 200209291338.14479.josh@agliodbs.com обсуждение исходный текст |
Список | pgsql-sql |
Postgres Folks, As long as we're talking about the ToDo list, I'd like to make some simple proposals regarding Postgres' conversion functions. 1) Addition of remaing to_char functions: We should add to_char functions for the following datatypes: to_char(interval, 'format string') (I believe this is already in the todo) to_char(inet, 'format string') 2) Addition of the following to-datatype conversion functions: to_inet(text, optional 'format string') to_interval(text, optional 'format string') to_time(text, optional 'format string') Without the "format string" these functions would operate like the current "Interval" and "time" functions, but not require quoting the function name. 3) Addition of datatype testing functions. All of these functions would test whether a text value is CASTable or transformable as the specific datatype and return a boolean value *without* raising an exception. The absence of analogous functions is one of many issues holding back PL/pgSQL from PL/SQL parity, as data type validation must take place outside functions. is_timestamp(text, optional 'format string') is_interval(text, optional 'format string') is_time(text, optional 'format string') is_date(text, optional 'format string') is_inet(text, optional 'format string') is_number(text, optional 'format string') -- -Josh BerkusAglio Database SolutionsSan Francisco
В списке pgsql-sql по дате отправления: