Re: Procedure for feature requests?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Procedure for feature requests?
Дата
Msg-id 20091003163239.GE5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Procedure for feature requests?  (Martin Gainty <mgainty@hotmail.com>)
Ответы Re: Procedure for feature requests?
Список 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 по дате отправления:

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: How useful is the money datatype?
Следующее
От: Corey Tisdale
Дата:
Сообщение: Embarassing GROUP question