Re: Function parameter names

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function parameter names
Date: 2003-11-23 17:19:19
Message-ID: Pine.LNX.4.44.0311231812080.4773-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dennis Bjorklund writes:

> I'm in the middle of implementing function parameter names.

How will that work in arbitrary procedural languages?

> Would it be a good idea to create a namevector in the same way as
> oidvector? Would a normal array like name[] be better?
>
> What is the reason for the oidvector to be it's own type instead of a
> oid[]?

An oidvector is fixed length, so you can access it via a C struct, like
pgprocval->proargtypes[2]. With a normal array, things get much more
complicated, and that cost would be fairly large if you want to resolve
the argument types of function calls. (This is the reason that the
maximum number of function parameters is limited to some arbitrary
number.)

So these two reasons make a "namevector" impractical: First, it would
probably not be in the performance critical path. Second, it would use up
a fixed length of NAMEDATALEN * FUNC_MAX_ARGS (currently 1024 bytes) in
every pg_proc row. In this case, a regular name[] would be more suitable.
Just be sure to put it after all the fixed-length fields.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-23 17:39:09 Re: Function parameter names
Previous Message Hans-Jürgen Schönig 2003-11-23 17:12:18 Re: ObjectWeb/Clustered JDBC