Function proposal to find the type of a datum

Поиск
Список
Период
Сортировка
От Kate F
Тема Function proposal to find the type of a datum
Дата
Msg-id 20070202005335.GB31510@cats.meow.at
обсуждение исходный текст
Список pgsql-hackers
Hi all,

I found the need to determine the type of a datum at runtime. David
Fetter and Elein have already written about this:
http://www.varlena.com/varlena/GeneralBits/117.php

(My scenario is similar to the article there; I was writing a
procedure which unit-tests other procedures. It needs to know the
type of arguments passed so that when constructing queries, it may
avoid quoting (for example) integers, so that the appropiate function
is selected for those which are overloaded. As I did not want to
assume that a user has permission to create PL functions in C, I
ended up casting to an integer and catching exceptions to determine
failure!)


I think this would be a useful function to expose by default. David
suggested pg_catalog.pg_type_of(ANYELEMENT).

If this is viewed as a good idea, I'd like to try to implement this.

Suggestions welcome,

-- 
Kate


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

Предыдущее
От: Jeremy Drake
Дата:
Сообщение: Re: writing new regexp functions
Следующее
От: Chander Ganesan
Дата:
Сообщение: Re: About PostgreSQL certification