C function argument types

From: Bogdan Vlad <bogdancvlad(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: C function argument types
Date: 2010-05-19 14:50:29
Message-ID: AANLkTilZCFsIyZOhERglPRcCCANdsfFF4bqGgBGD74rv@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

How can I determine the pg_class oid of the argument type in a
polymorphic C function when it's called with a table row?

PG_FUNCTION_INFO_V1(myfunc);
Datum myfunc(PG_FUNCTION_ARGS)
{
Oid arg_type = get_fn_expr_argtype(fcinfo->flinfo, 0);
elog(ERROR, "arg_type %d", arg_type);
PG_RETURN_NULL();
}

select myfunc(mytable) from mytable;
arg_type 65754

select 'mytable'::regclass::oid
65752

I expected them to be equal.
What gives?

For other table the results are 65783 vs 65785.

I'm running v 8.4.3

Thanks,
Bogdan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-05-19 14:54:01 Re: BYTEA / DBD::Pg change in 9.0 beta
Previous Message Stefan Kaltenbrunner 2010-05-19 14:17:08 Re: BYTEA / DBD::Pg change in 9.0 beta