Ivan Sergio Borgonovo wrote:
It would be nice to at least a list of functions that could be used
in extension development to avoid reading all the source.
psql -E
\df *
This will dump out a list of all the built-in functions in the server.
It will also show you the query that did so, I get one that looks like this:
SELECT n.nspname as "Schema",
p.proname as "Name",
pg_catalog.pg_get_function_result(p.oid) as "Result data type",
pg_catalog.pg_get_function_arguments(p.oid) as "Argument data types",
CASE
WHEN p.proisagg THEN 'agg'
WHEN p.proiswindow THEN 'window'
WHEN p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype THEN
'trigger'
ELSE 'normal'
END as "Type"
FROM pg_catalog.pg_proc p
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE pg_catalog.pg_function_is_visible(p.oid)
AND n.nspname <> 'pg_catalog'
AND n.nspname <> 'information_schema'
ORDER BY 1, 2, 4;
If you run that, and maybe filter it down to only look at stuff similar
to what you're looking for (example: only show things where the Result
data type returns 'text' because that's what you need), that will give
you an idea what functions might be suitable to borrow from. grep for
them in the source code, you'll find them only once in the table that
maps them to actual function names on the code. Grab that name, grep
for it, and then you'll be sitting at example code that might be
interesting to you.
The other thing I'd recommend is surfing the code via
http://doxygen.postgresql.org/ , along with reading through the modules
in contrib/ as already suggested (which won't be found by the query
above because they're optional).
--
Greg Smith 2ndQuadrant Baltimore, MD
PostgreSQL Training, Services and Support
greg@xxxxxxxxxxxxxxx www.2ndQuadrant.com
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general