Type checking

Поиск
Список
Период
Сортировка
От Don Y
Тема Type checking
Дата
Msg-id 446A4107.4070001@DakotaCom.Net
обсуждение исходный текст
Ответы Re: Type checking  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

I have several user defined types with particular restraints
upon the data they represent.  If I have crafted my foo_in()
function to ensure that these constraints are always satisfied
*before* allowing a datum into the database AND I have designed
my casts to be similarly vigilant, is there any OTHER way that
data can creep into the database that is noncompliant?

I.e., if I have a bunch of functions defined as taking an
argument of type "foo", is there any way the user can pass
a value to these functions WITHOUT it going through my
gatekeepers (foo_in(), foo_from_baz(), etc.)?  Obviously,
the reason for my question is to verify that the functions
that take foo arguments need not be concerned with verifying
that their arguments are, in fact, compliant with the rules
defined (enforced) for that type.

E.g., if the foo type excludes the value '0', can I write
a routine inverse(foo) that computes 1/x for any value of
x without testing for x==0?

<grimace>  Am I being clear enough about the question I am
asking?  :-/

Thanks!
--don

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: FATAL: could not read statistics message
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Announce: GPL Framework centered on Postgres