pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew C.R. Martin <a.c.r.martin@reading.ac.uk>
Cc: interfaces@postgresql.org
Cc: docs@postgresql.org
Cc: hackers@postgresql.org
Subject: Re: [HACKERS] Re: Bugs: Programming Language Functions
Date: Tue, 11 Apr 2000 13:33:41 -0400
Message-ID: <1708.955474421@sss.pgh.pa.us> (raw)
In-Reply-To: <00041118092100.28482@sapc13.rdg.ac.uk>
References: <1291.955469139@sss.pgh.pa.us>
	<00041118092100.28482@sapc13.rdg.ac.uk>

"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



view thread (8+ messages)  latest in thread

Message-ID: <1708.955474421@sss.pgh.pa.us>
Permalink:  ../1708.955474421@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1708.955474421@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, a.c.r.martin@reading.ac.uk, interfaces@postgresql.org, docs@postgresql.org, hackers@postgresql.org
  Subject: Re: [HACKERS] Re: Bugs: Programming Language Functions
  In-Reply-To: <1708.955474421@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox