Re: Composite Types and Function Parameters

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Composite Types and Function Parameters
Дата
Msg-id 4CC8F747.9010001@dunslane.net
обсуждение исходный текст
Ответ на Re: Composite Types and Function Parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Composite Types and Function Parameters  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers

On 10/27/2010 11:38 PM, Tom Lane wrote:
> Andrew Dunstan<andrew@dunslane.net>  writes:
>> But I think we can do better than this. We should really pass an hashref
>> with the record's column names as keys rather than just calling
>> record_out. I'll work on that.
> Definitely.  If you aren't providing that info then it's hard to write
> a generic function, which is more or less the whole point here.  I'd
> even argue that it'd be nice if the function could find out the data
> types of the record's columns; though I have no idea what a reasonable
> API for that would be in Perl.



Well, it turns out that the hashref required exactly one more line to
achieve. We already have all the infrastructure on the composite
handling code, and all it requires it to enable it for the RECORDOID case.

As for your idea of exposing type info, we could certainly do that using
the same mechanism we use for the trigger $_TD stuff.

Patch so far attached.

cheers

andrew

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Composite Types and Function Parameters
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Simplifying replication