"Kevin Grittner" writes:
> Jon Nelson 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 inde
Jon Nelson 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.
Try this:
create table t (id int not null primary key, txt text);
create index t_weird on t ((substring(txt, 1, id)));
create
On Thu, Apr 21, 2011 at 11:28 AM, Tom Lane wrote:
> Jon Nelson writes:
>> SQLAlchemy encountered an error introspecting the tables. After
>> inspecting the SQL that it was running, I boiled it down to this:
>
>> SELECT c.relname, a.attname
>> FROM pg_index i, pg_class c, pg_attribute a
>> WHERE
Jon Nelson writes:
> SQLAlchemy encountered an error introspecting the tables. After
> inspecting the SQL that it was running, I boiled it down to this:
> SELECT c.relname, a.attname
> FROM pg_index i, pg_class c, pg_attribute a
> WHERE i.indrelid = '16684' AND i.indexrelid = c.oid
> AND a.att
I'm using SQLAlchemy which has database introspection smarts.
Basically, you point it at a database and tell it to find out what
tables are there and introspect them, the table indices, etc...
It works super.
Until today.
Yesterday, I restructured one of my tables (specifically, I dropped
one col