Re: [HACKERS] Re: Bugs: Programming Language Functions
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] Re: Bugs: Programming Language Functions |
Дата | |
Msg-id | 1708.955474421@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] Re: Bugs: Programming Language Functions ("Andrew C.R. Martin" <a.c.r.martin@reading.ac.uk>) |
Список | pgsql-docs |
"Andrew C.R. Martin" <a.c.r.martin@reading.ac.uk> writes: >> Hm. I'm not too clear on why that would need to worry about either >> TupleTableSlot or GetAttributeByName ... shouldn't it be a simple >> function consuming a text Datum and producing another? > Errrmmm, just following the instructions in the docs: > Programmer's Manual, Chapter 4. Extensing SQL: Functins (page > x414.htm), under the C examples. OK, I see. You've got a function that accepts an entire tuple and has hard-wired assumptions about which fields to extract from the tuple. Certainly there are cases where that's what's needed, but I'd be inclined to define the function as taking two parameters int4 and text*, then calling it as myfunc(table.codon, table.substitution). That pushes the need for tuple field access out of your code. That doesn't affect the validity of your point, of course. We have done wholesale renamings of backend types, fields, and functions, as part of an ongoing effort to clean up the code; and I expect there will be more in future. Perhaps we should pay more attention to not breaking user functions unnecessarily when we do this. regards, tom lane
В списке pgsql-docs по дате отправления: