Unix Technical Forum

pg_stat_user_tables

This is a discussion on pg_stat_user_tables within the Pgsql General forums, part of the PostgreSQL category; --> I'm selecting tables from my db using query: SELECT pg_stat_user_tables.relname FROM pg_stat_user_tables WHERE (pg_stat_user_tables.relname LIKE 'name_hosp_%') The problem I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 11:23 PM
JackpipE
 
Posts: n/a
Default pg_stat_user_tables

I'm selecting tables from my db using query:
SELECT
pg_stat_user_tables.relname
FROM
pg_stat_user_tables
WHERE
(pg_stat_user_tables.relname LIKE 'name_hosp_%')

The problem I have is that the table names returned by this query are
different from the ones in my db. Not all of them but 10%-20%. The
common problem I noticed is adding "_" at the end of table name and
truncating name "hospital" to "hosp".
Anyone ever had similar problem? Any other way to get list of table
names?

Thanks,
JP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 11:23 PM
Tom Lane
 
Posts: n/a
Default Re: pg_stat_user_tables

JackpipE <pipe.jack@gmail.com> writes:
> I'm selecting tables from my db using query:
> SELECT
> pg_stat_user_tables.relname
> FROM
> pg_stat_user_tables
> WHERE
> (pg_stat_user_tables.relname LIKE 'name_hosp_%')


> The problem I have is that the table names returned by this query are
> different from the ones in my db.


That hardly seems likely, since the contents of that view are drawn
directly from pg_class. Maybe you have some old schemas you've
forgotten about?

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:15 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com