Re: Catalogs design question - Mailing list pgsql-hackers

From Steve Howe
Subject Re: Catalogs design question
Date
Msg-id 005b01c15f75$4990c000$8430b0c8@angla
Whole thread Raw
In response to Re: Catalogs design question  (Haller Christoph <ch@rodos.fzk.de>)
Responses Re: Catalogs design question
List pgsql-hackers
Hello Haller!!!
> Your question about  - pg_proc
> select t.typname from pg_type t , pg_proc p
> where p.proname = '<your_stored_procedure>' and p.proargtypes[0] = t.oid ;
> select t.typname from pg_type t , pg_proc p
> where p.proname = '<your_stored_procedure>' and p.proargtypes[1] = t.oid ;
> ...
> select t.typname from pg_type t , pg_proc p
> where p.proname = '<your_stored_procedure>' and p.proargtypes[7] = t.oid ;
>
> As far as I understand the proargtypes entries 0 means no further
parameter.
> This oidvector type of proargtypes seems to have a start index of 0.
> As long as there are at maximum 8 parameters allowed, this looks
practicable.
There is no limit on the number of arguments. An user could create a weird
function like this:

howe=# CREATE FUNCTION test2(int2, int2, int2, int2, int2, int2, int2, int2,
int2, int2, int2, int2, int2) RETURNS int4AS 'SELECT 1 AS RESULT' LANGUAGE 'sql';
CREATE

and it would be allowed...

howe=# select proargtypes from pg_proc where proname='test';             proargtypes
----------------------------------------21 21 21 21 21 21 21 21 21 21 21 21 21
(1 row)

Again, the problem is that I can't predict (nor limit) what users will try
to do...


Best Regards,
Steve Howe



pgsql-hackers by date:

Previous
From: mlw
Date:
Subject: Optimizer, index use, good news for 7.2b1
Next
From: Bruce Momjian
Date:
Subject: Re: pgindent run