On Sep 14, 2009, at 1:36 AM, Greg Smith wrote:
> CASE
> WHEN c1.relkind='r' THEN 'table'
> WHEN c1.relkind='i' THEN 'index'
> WHEN c1.relkind='S' THEN 'sequence'
> WHEN c1.relkind='v' THEN 'view'
> WHEN c1.relkind='c' THEN 'composite'
> WHEN c1.relkind='t' THEN 'TOAST'
> ELSE '?'
> END as "kind",
I think part of this patch should be providing a function or
something that converts things like pg_class.relkind into a useful
string. I know I've created a function that does that (though, I
return a cased string, since it's easier to run it through lower than
to try and case it after the fact). I'm not sure if a function is the
best way to do this or if a table or view would be better (something
you could join to). One benefit of a table or view is that you could
provide both cased and lower versions of the names.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828