Search Postgresql Archives

Re: Determine a function's volatility in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

2011/11/12 Bborie Park <bkpark@xxxxxxxxxxx>:
> Hey all,
>
> I'm wondering if there is a way to determine a function's volatility
> in C.  The function information provided through fmgr_info() doesn't
> provide it.  Ideas?
>

you should to look to pg_proc table

search in postgresql code

         tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
        if (!HeapTupleIsValid(tuple))
                elog(ERROR, "cache lookup failed for function %u", funcoid);
        proc = (Form_pg_proc) GETSTRUCT(tuple);

 ...


        switch (proc->provolatile)
        {
                case PROVOLATILE_IMMUTABLE:
                        appendStringInfoString(&buf, " IMMUTABLE");
                        break;
                case PROVOLATILE_STABLE:
                        appendStringInfoString(&buf, " STABLE");
                        break;
                case PROVOLATILE_VOLATILE:
                        break;
        }

...

        ReleaseSysCache(tuple);

Regards

Pavel Stehule


> Thanks,
> Bborie
>
> --
> Bborie Park
> Programmer
> Center for Vectorborne Diseases
> UC Davis
> 530-752-8380
> bkpark@xxxxxxxxxxx
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux