Thread: Re: [GENERAL] Patch for PGACCESS

Re: [GENERAL] Patch for PGACCESS

From
Bruce Momjian
Date:
> Sorry my English.
> Anyone know a trubl PGACCESS (with PostgreSQL 7.1.1) in View Functions show
> _all_ system functions.
> For resolve it you must replase in ..../pgaccess/lib/mainlib.tcl function
> to my function:

I have attached a patch that you suggested.  I see the problem is that
_every_ function is listed.  You solution is to list only functions you
own.  The problem I see here is that I don't see other parts of pgaccess
listing only things I own.

Does anyone have a good way of improving this patch?  I can't think of
any way of listing only non-system functions.

--
  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
*** mainlib.tcl    Thu Feb  8 14:57:50 2001
--- /bjm/12    Wed May 30 10:48:09 2001
***************
*** 105,111 ****


  proc {cmd_Functions} {} {
! global CurrentDB
      set maxim 16384
      setCursor CLOCK
      catch {
--- 105,111 ----


  proc {cmd_Functions} {} {
! global CurrentDB PgAcVar
      set maxim 16384
      setCursor CLOCK
      catch {
***************
*** 115,121 ****
      }
      .pgaw:Main.lb delete 0 end
      catch {
!         wpg_select $CurrentDB "select proname from pg_proc where oid>$maxim order by proname" rec {
              .pgaw:Main.lb insert end $rec(proname)
          }
      }
--- 115,128 ----
      }
      .pgaw:Main.lb delete 0 end
      catch {
!     set alex_owner_id $PgAcVar(opendb,username)
! if {! $PgAcVar(pref,systemtables)} {
!     set alex_owner " and proowner = (SELECT usesysid FROM pg_user WHERE usename = '$alex_owner_id') "
! } else {
!     set alex_owner ""
! }
!
!         wpg_select $CurrentDB "select proname from pg_proc where oid>$maxim $alex_owner order by proname" rec {
              .pgaw:Main.lb insert end $rec(proname)
          }
      }
***************
*** 1014,1018 ****
      grid $base.fb.btncancel \
          -in .pgaw:OpenDB.fb -column 1 -row 0 -columnspan 1 -rowspan 1 -padx 5
  }
-

--- 1021,1024 ----

Re: Re: [GENERAL] Patch for PGACCESS

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I have attached a patch that you suggested.  I see the problem is that
> _every_ function is listed.  You solution is to list only functions you
> own.

This is certainly not a correct solution.

The problem is that pgaccess has not been updated to know the correct
way of determining the last system OID in 7.1 (OID of template1 is not
the thing to look at anymore).  It should do something similar to what
pg_dump does --- see the two alternative implementations of
findLastBuiltinOid in pg_dump.c.

            regards, tom lane