Re: Elementary dependency look-up - Mailing list pgsql-hackers

From decibel
Subject Re: Elementary dependency look-up
Date
Msg-id E65FD0CE-8EC5-40F4-B384-69AAC85BA2FC@decibel.org
Whole thread Raw
In response to Re: Elementary dependency look-up  (Greg Smith <gsmith@gregsmith.com>)
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: Patch for automating partitions in PostgreSQL 8.4 Beta 2
Next
From: Pavel Stehule
Date:
Subject: Re: RfD: more powerful "any" types