Robert Treat writes:
> One idea I've always thought would be nice would be to make full fledged
> C functions out of the \ commands and ship them with the database.
The psql meta-commands are not a nicely designed set of queries that one
would encapsulate into a public library interface. They are created for
interactive use, representing precomposed views of the database that are
thought to be useful. If the ideas of usefulness change, then the
commands might change.
If you want to create a set of views or functions for noninteractive use
by client applications, then you need to step back and create maximally
decomposed views of the database that can be combined in all possible
ways. The SQL information schema is such a set, but the information is
perhaps too limited for some applications. (But I urge you too look
first.) But any other set would have to be designed on similar
principles.
--
Peter Eisentraut peter_e@gmx.net