pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Jon Nelson <jnelson+pgsql@jamponi.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: database introspection error
Date: Sat, 23 Apr 2011 15:53:48 -0400
Message-ID: <4473.1303588428@sss.pgh.pa.us> (raw)
In-Reply-To: <4DB17239020000250003CBF2@gw.wicourts.gov>
References: <BANLkTineAbe68mrzpuF7VY5Ag5MGqc+_cQ@mail.gmail.com>
	<24590.1303403331@sss.pgh.pa.us>
	<BANLkTik-DoXEhya3pCJv=0v-wAR+qwz9oQ@mail.gmail.com>
	<4DB17239020000250003CBF2@gw.wicourts.gov>

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Jon Nelson <jnelson+pgsql@jamponi.net> wrote:
>> Would the following query be more (most?) correct, assuming the
>> oid of the table is known?
 
> It doesn't seem to work for indexes on expressions.

Depends on what you mean by "work".  If you're looking for attributes
that are used as simple index columns, it's probably fine.  If you want
to also find attributes that are used in index expressions, you might
want to make use of a join through pg_depend.  One disadvantage of
pg_depend is that it doesn't help for system catalog indexes (because
indexes built at bootstrap time aren't included in pg_depend) --- not
sure if that is something SQLAlchemy cares about.

			regards, tom lane



view thread (5+ messages)

Message-ID: <4473.1303588428@sss.pgh.pa.us>
Permalink:  ../4473.1303588428@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4473.1303588428@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov, jnelson+pgsql@jamponi.net
  Subject: Re: database introspection error
  In-Reply-To: <4473.1303588428@sss.pgh.pa.us>
  References: <BANLkTineAbe68mrzpuF7VY5Ag5MGqc+_cQ@mail.gmail.com> <24590.1303403331@sss.pgh.pa.us> <BANLkTik-DoXEhya3pCJv=0v-wAR+qwz9oQ@mail.gmail.com> <4DB17239020000250003CBF2@gw.wicourts.gov> <4473.1303588428@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox