Re: Re: [GENERAL] Patch for PGACCESS - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Re: [GENERAL] Patch for PGACCESS
Date
Msg-id 200105301807.f4UI72Q09896@candle.pha.pa.us
Whole thread Raw
In response to Re: Re: [GENERAL] Patch for PGACCESS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I don't see any code that does version-specific stuff in pgaccess, so I
> > guess this will have to be only for > 7.1 backends.
>
> It would probably be easy to try the datlastsysoid query, and if that
> fails (remember that column is new in 7.1) fall back to the old way.

Got it.  Applied and tested.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
? pgaccess
Index: lib/mainlib.tcl
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/bin/pgaccess/lib/mainlib.tcl,v
retrieving revision 1.7
diff -c -r1.7 mainlib.tcl
*** lib/mainlib.tcl    2001/02/07 21:30:12    1.7
--- lib/mainlib.tcl    2001/05/30 18:06:26
***************
*** 105,116 ****


  proc {cmd_Functions} {} {
! global CurrentDB
      set maxim 16384
      setCursor CLOCK
!     catch {
!         wpg_select $CurrentDB "select oid from pg_database where datname='template1'" rec {
!             set maxim $rec(oid)
          }
      }
      .pgaw:Main.lb delete 0 end
--- 105,122 ----


  proc {cmd_Functions} {} {
! global PgAcVar CurrentDB
      set maxim 16384
      setCursor CLOCK
!     set dbname $PgAcVar(opendb,dbname)
!     if [catch {wpg_select $CurrentDB "select datlastsysoid from pg_database where datname='$dbname'" rec {
!             set maxim $rec(datlastsysoid)
!         }
!     }] {
!         catch {
!             wpg_select $CurrentDB "select oid from pg_database where datname='template1'" rec {
!                 set maxim $rec(oid)
!             }
          }
      }
      .pgaw:Main.lb delete 0 end

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [GENERAL] Patch for PGACCESS
Next
From: Bruce Momjian
Date:
Subject: Re: Patch to remove sort files, temp tables, unreferenced files