Re: [SQL] Joining a result set from four (4) tables

2006-08-01 Thread John Tregea
Hi Aaron, Thanks very much, I really appreciate both the solution and the advice about naming conventions. Your script worked fine and gives me an example of what to do for other situations as well. Because the logic structure of this software is in the front end application rather than the

Re: [SQL] viewing the description of tables from python DB-API

2006-08-01 Thread Rodrigo De Leon
On 8/1/06, Daniel Joo <[EMAIL PROTECTED]> wrote: Hi all, Is there a way to view the list of all tables from python (or any other languages for that matter) DB-API? What I'm looking for is a command similar to the meta-command '\d' that works with the psql client. Thanks very much! Dan

Re: [SQL] viewing the description of tables from python DB-API

2006-08-01 Thread Alvaro Herrera
Daniel Joo wrote: > Is there a way to view the list of all tables from python (or any other > languages for that matter) DB-API? What I'm looking for is a command > similar to the meta-command '\d' that works with the psql client. Try \d under psql -E sometime. It'll give you the query it use

[SQL] viewing the description of tables from python DB-API

2006-08-01 Thread Daniel Joo
Hi all,   Is there a way to view the list of all tables from python (or any other languages for that matter) DB-API?  What I’m looking for is a command similar to the meta-command ‘\d’ that works with the psql client.    Thanks very much!   Dan  

Re: [SQL] Joining a result set from four (4) tables

2006-08-01 Thread Aaron Bono
On 7/31/06, John Tregea <[EMAIL PROTECTED]> wrote: Hi aaron,Here are the 'create table' statements. I have indicated what are theprimary and foreign keys with trailing comments.ThanksJohnAaron Bono wrote:> Can you include the table create statements with primary and foreign > keys?  That would help

Re: [SQL] finding unused indexes?

2006-08-01 Thread Brad Nicholson
On Tue, 2006-08-01 at 09:05 -0700, George Pavlov wrote: > Anybody have a clever way to quickly find whether there are any unused > indexes in a PG DB? One way I have done is to take queries from the DB > log, prepend an explain to each and grep the results, but I am wondering > if there are either

Re: [SQL] finding unused indexes?

2006-08-01 Thread Jim Buttafuoco
check out pg_stat_user_indexes, you will need to turn on the stats collection in your postgresql.conf file first. Jim -- Original Message --- From: "George Pavlov" <[EMAIL PROTECTED]> To: Sent: Tue, 1 Aug 2006 09:05:34 -0700 Subject: [SQL] finding unused indexes? > Anybody hav

[SQL] finding unused indexes?

2006-08-01 Thread George Pavlov
Anybody have a clever way to quickly find whether there are any unused indexes in a PG DB? One way I have done is to take queries from the DB log, prepend an explain to each and grep the results, but I am wondering if there are either any index usage stats maintained somewhere inside Postgres or i