Re: Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query
От | Tom Lane |
---|---|
Тема | Re: Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query |
Дата | |
Msg-id | 2069593.1739143167@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query (Ugur Yilmaz <ugurlu2001@hotmail.com>) |
Ответы |
Re: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query
|
Список | pgsql-bugs |
Ugur Yilmaz <ugurlu2001@hotmail.com> writes: > Thank you for the explanations and information. Although I find your answers convincing; I still can't understand why Ican't get the desired result from the Varchar(n) type, whose -max- length I explicitly specified in the "Returns Table"statement. Yeah. There is about zero chance that we are going to rework that: the decision that function argument and result types are identified by type OID alone is ancient and deeply rooted. Even ignoring the costs of changing a lot of code, there are semantic problems. For example, should we allow both of these functions to exist concurrently? create function f(varchar(100)) returns ...; create function f(varchar(200)) returns ...; If so, which do we pick when we're uncertain about the length of the argument value? You could however make a reasonable case that we should not accept "varchar(200)" in contexts where we're going to ignore the "(200)" part. That's pretty ancient too, cf this comment in gram.y: * We can catch over-specified arguments here if we want to, * but for now better to silently swallow typmod, etc. * - thomas 2000-03-22 I'm not sure whether rejecting such things would make more people happy than it made unhappy. In any case, there's a whole lot of history here and a lot of reason to worry about backwards compatibility. regards, tom lane
В списке pgsql-bugs по дате отправления: