Re: [HACKERS] A small problem with the new inet and cidr types
От | Hannu Krosing |
---|---|
Тема | Re: [HACKERS] A small problem with the new inet and cidr types |
Дата | |
Msg-id | 363EE400.E20CF87D@trust.ee обсуждение исходный текст |
Ответ на | Re: [HACKERS] A small problem with the new inet and cidr types (jwieck@debis.com (Jan Wieck)) |
Список | pgsql-hackers |
Jan Wieck wrote: > > Not calling a function if one of it's arguments is NULL? > Isn't NULL a legal value? > > I know that the function manager interface is damned stupid > in the case of NULL's. Some of the interface functions pass > isNull as in/out value and some do not. And the in value only > tells if any of the arguments are NULL, not which of them. It > hit me when building PL/pgSQL and PL/Tcl. > > Let's redesign the function call interface and define that > any function has to handle NULL arguments properly. Yes, I > know what that means :-). An easier way would be _not_ to call a function with NULL arguments, _unless_ it declares that it can handle them. It would probably do the right thing in many (most?) places. But we do need to redesign not only the function _call_ interface, but most likely also the function _definition_ mechanisms as well. On the whole I would like the functions to be more object-like, meaning that they should have methods (metadata) that could tell things about them. In addition to an method that tells if the function can take NULL as an argument and in what positions, I envision we could also use a method that would tell the max print length and other "field" attribute of the function return value given the attributes of function arguments. For example we would be able to determine that the max length of concatenating varchar(5) and varchar(7) is varchar(12) and not a varchar of infinite length as we have to assume now. Is'nt PostgreSQL supposed to be somewhat OO DBMS ? ---------- Hannu
В списке pgsql-hackers по дате отправления: