Re: [HACKERS] Re: Bugs: Programming Language Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrew C(dot)R(dot) Martin" <a(dot)c(dot)r(dot)martin(at)reading(dot)ac(dot)uk>
Cc: interfaces(at)postgresql(dot)org, docs(at)postgresql(dot)org, hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: Bugs: Programming Language Functions
Date: 2000-04-11 17:33:41
Message-ID: 1708.955474421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-interfaces

"Andrew C.R. Martin" <a(dot)c(dot)r(dot)martin(at)reading(dot)ac(dot)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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Henry B. Hotz 2000-04-11 17:57:45 Re: Re: Postgres vs. PostgreSQL
Previous Message Andrew C.R. Martin 2000-04-11 17:04:17 Re: [HACKERS] Re: Bugs: Programming Language Functions

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jeffrey Silberberg 2000-04-11 22:07:11 Text Field will not map into MS Access as Type: Memo
Previous Message Andrew C.R. Martin 2000-04-11 17:04:17 Re: [HACKERS] Re: Bugs: Programming Language Functions