pg_dump problems against 7.0

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема pg_dump problems against 7.0
Дата
Msg-id 3F939C9F.2010305@familyhealth.com.au
обсуждение исходный текст
Ответы Re: pg_dump problems against 7.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
(Sorry I posted this to -hackers by accident initially)

I noticed that the function to get max builtin OID for 7.0 does this:

template1=> SELECT oid from pg_database where datname = 'template1';
   oid
-------
  17216
(1 row)

However, that is incorrect:

template1=> select oid,relname from pg_class where oid > 17216;
   oid  |  relname
-------+------------
  17408 | pg_indexes
  17280 | pg_user
  17312 | pg_rules
  17344 | pg_views
  17376 | pg_tables
(5 rows)

Which results in all the system views being dumped.  Attached is a
patch.  Please tell me if it's OK.

Chris



Index: pg_dump.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.353
diff -c -r1.353 pg_dump.c
*** pg_dump.c    8 Oct 2003 03:52:32 -0000    1.353
--- pg_dump.c    20 Oct 2003 08:25:24 -0000
***************
*** 5876,5882 ****
       int            last_oid;

       res = PQexec(g_conn,
!               "SELECT oid from pg_database where datname = 'template1'");
       if (res == NULL ||
           PQresultStatus(res) != PGRES_TUPLES_OK)
       {
--- 5876,5882 ----
       int            last_oid;

       res = PQexec(g_conn,
!               "SELECT oid FROM pg_class ORDER BY oid DESC LIMIT 1");
       if (res == NULL ||
           PQresultStatus(res) != PGRES_TUPLES_OK)
       {
Index: pg_dump.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.353
diff -c -r1.353 pg_dump.c
*** pg_dump.c    8 Oct 2003 03:52:32 -0000    1.353
--- pg_dump.c    20 Oct 2003 08:25:24 -0000
***************
*** 5876,5882 ****
      int            last_oid;

      res = PQexec(g_conn,
!               "SELECT oid from pg_database where datname = 'template1'");
      if (res == NULL ||
          PQresultStatus(res) != PGRES_TUPLES_OK)
      {
--- 5876,5882 ----
      int            last_oid;

      res = PQexec(g_conn,
!               "SELECT oid FROM pg_class ORDER BY oid DESC LIMIT 1");
      if (res == NULL ||
          PQresultStatus(res) != PGRES_TUPLES_OK)
      {

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

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: Make pg_dump dump conversions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump problems against 7.0