pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: Proposal for Clean-up of Conversion Functions
Date: Sun, 29 Sep 2002 13:38:14 -0700
Message-ID: <200209291338.14479.josh@agliodbs.com> (raw)

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 Berkus
 Aglio Database Solutions
 San Francisco




Message-ID: <200209291338.14479.josh@agliodbs.com>
Permalink:  ../200209291338.14479.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200209291338.14479.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: Proposal for Clean-up of Conversion Functions
  In-Reply-To: <200209291338.14479.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox