Re: Inspecting a DB - psql or system tables ?
От | Greg Smith |
---|---|
Тема | Re: Inspecting a DB - psql or system tables ? |
Дата | |
Msg-id | 4DE1B360.4080801@2ndQuadrant.com обсуждение исходный текст |
Ответ на | Inspecting a DB - psql or system tables ? (Andre Majorel <aym-2lqsgp@teaser.fr>) |
Список | pgsql-general |
On 05/27/2011 01:24 PM, Andre Majorel wrote: > While parsing the output of psql is cumbersome, accessing the > system tables seems more likely to break whenever a new version > of PostgreSQL comes out. > I think you have this backwards. If there's a change in this area big enough to justify changing the format of the system tables, odds are the text output from psql is going to be changed too. psql gets tweaked to display information better more often than the internals are altered. Approaches you can take here, from most robust in the face of changes to most fragile, in my mind are: 1) Use information_schema. If all the info you need is in here, great; it may not be though. 2) Use the system catalog data directly 3) Parse text output from psql. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
В списке pgsql-general по дате отправления: