Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-docspgsql-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

pgsql-docs by date

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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group