Re: Elementary dependency look-up

From: decibel <decibel(at)decibel(dot)org>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Josh Williams <joshwilliams(at)ij(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Elementary dependency look-up
Date: 2009-09-14 17:42:31
Message-ID: E65FD0CE-8EC5-40F4-B384-69AAC85BA2FC@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-09-14 17:42:42 Re: RfD: more powerful "any" types
Previous Message Grzegorz Jaskiewicz 2009-09-14 17:40:44 Re: Patch for automating partitions in PostgreSQL 8.4 Beta 2