Skip site navigation (1) Skip section navigation (2)

Re: Standard metadata queries

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Steve Atkins <steve(at)blighty(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Standard metadata queries
Date: 2008-04-24 18:12:58
Message-ID: 20080424111258.5f554313@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, 24 Apr 2008 11:01:13 -0700
Steve Atkins <steve(at)blighty(dot)com> wrote:

> I've been chatting with the Trolltech folks about the implementation  
> of the Qt wrapper around libpq, and the issue of how to properly do  
> metadata queries came up. That is things like "What are the column  
> names and types of the primary key of this table, and what index  
> enforces it?" or "What are the names and types of each field of this  
> table?".
> 
> These seem like queries that'll be used by a lot of people, hidden  
> down in ORMs and access libraries, and which are hard to get right,  
> let alone efficient, and which will generally be written by one
> person (developing the ORM or library) and likely not touched again.
> 
> Is there a standard set of well-crafted implementations of these  
> anywhere that could be used by all the interface and ORM developers?  
> If not, would it make sense to put some together and document or
> wiki them? Both as example code and as a set of good, solid queries
> that library developers can cut and paste.
> 
> (The implementation I'm looking at right now has, amongst other  
> things, hardwired OID-to-type mappings, and there's got to be a  
> cleaner way than that).

I believe the information_schema is standard.

Joshua D. Drake

> 
> Cheers,
>    Steve
> 
> 


-- 
The PostgreSQL Company since 1997: http://www.commandprompt.com/ 
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate



In response to

Responses

pgsql-hackers by date

Next:From: Steve AtkinsDate: 2008-04-24 18:22:53
Subject: Re: Standard metadata queries
Previous:From: Steve AtkinsDate: 2008-04-24 18:01:13
Subject: Standard metadata queries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group