Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA04834; Tue, 11 Apr 2000 13:34:27 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id NAA01711; Tue, 11 Apr 2000 13:33:41 -0400 (EDT) To: "Andrew C.R. Martin" cc: interfaces@postgresql.org, docs@postgresql.org, hackers@postgresql.org Subject: Re: [HACKERS] Re: Bugs: Programming Language Functions In-reply-to: <00041118092100.28482@sapc13.rdg.ac.uk> References: <1291.955469139@sss.pgh.pa.us> <00041118092100.28482@sapc13.rdg.ac.uk> Comments: In-reply-to "Andrew C.R. Martin" message dated "Tue, 11 Apr 2000 18:04:17 +0100" Date: Tue, 11 Apr 2000 13:33:41 -0400 Message-ID: <1708.955474421@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200004/48 "Andrew C.R. Martin" 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