Re: Procedure for feature requests? - Mailing list pgsql-general

From Sam Mason
Subject Re: Procedure for feature requests?
Date
Msg-id 20091003163239.GE5407@samason.me.uk
Whole thread Raw
In response to Re: Procedure for feature requests?  (Martin Gainty <mgainty@hotmail.com>)
Responses Re: Procedure for feature requests?
List pgsql-general
 [ please don't top-post it's difficult to follow for those not directly
   involved in the discussion ]

On Sat, Oct 03, 2009 at 12:14:19PM -0400, Martin Gainty wrote:
> is there a way to create a cast with assignment e.g.?

Hum, I'm unsure how this would help.  Maybe more explanation would help?

> CREATE CAST ((date,date) AS int4) WITH FUNCTION generate_series(date,date) AS ASSIGNMENT;

generate_series returns to a SETOF values.  It also has *much* more
complicated semantics than I'd expect most people would attribute as
useful to a datatype conversion function.  For example, why would
casting from a pair of dates end up as a set of rows containing a single
date value?


I have a large problem understanding the real purpose casts so maybe I'm
missing something.  My problem is that I don't understand the purpose
of trying to provide a "standard" way of converting between arbitrary
datatypes, it seems much easier to just provide a standard set of domain
specific functions that are explicitly used by the user.  The SQL
standard specifies that they need to exist so PG has to support them,
but their purpose still confuses me!

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: How useful is the money datatype?
Next
From: Corey Tisdale
Date:
Subject: Embarassing GROUP question