Re: Procedure for feature requests?

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Procedure for feature requests?
Date: 2009-10-03 16:32:39
Message-ID: 20091003163239.GE5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-10-03 16:48:57 Re: Procedure for feature requests?
Previous Message Corey Tisdale 2009-10-03 16:25:14 Embarassing GROUP question