Re: Tablespace patch review

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Tablespace patch review
Дата
Msg-id 200406190147.i5J1lhC05652@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Tablespace patch review  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Tablespace patch review  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> Somebody's got to fix oid2name and dbsize though.  Bruce, you want
> >> to catch those?
>
> > Uh, how do they have to be fixed?  Isn't the relfilenode unchanged?  Do
> > we just need to add tablespace lookups?
>
> How useful will oid2name be if it doesn't understand about tablespaces?
> I dunno how it ought to be changed, but surely it needs some thought.

Well, I figure we would copy the database capability we have for
tablespaces.

If you call oid2name with no args, you get:

    All databases:
    ---------------------------------
    17219  = test
    1      = template1
    17218  = template0

If we specify just the database name we get:

    (2) aspg oid2name -d template1
    All tables from database "template1":
    ---------------------------------
    17147  = sql_features
    17152  = sql_implementation_info
    17157  = sql_languages
    17162  = sql_packages
    17167  = sql_sizing
    17172  = sql_sizing_profiles

I assume we just need to add a tablespace display when run with no args,
and a -s option to display _with_ -d to display only objects in that
database.  We could go fancy and spin through all the databases and list
the datbase name and objects in that tablespace.

> dbsize doesn't even compile right now, because it's using
> GetDatabasePath which now has another argument.  I did not patch it
> because it needs more thought: should it report the total of all
> tablespaces for the database, or should its API be extended so you
> can ask about individual tablespaces, or what?  In any case it's
> not a one-liner fix...

For dbsize, I assume we have to follow the symlinks.  We would have to
spin through all the tablespaces looking for directories with the
database oid.

Given the number of open items for 7.5, I am thinking of keeping this
for post-feature freeze.  Both are contrib.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Tablespace patch review
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tablespace patch review