Thread

  1. Patch for PGACCESS

    Alexander Dederer <dederer@spb.cityline.ru> — 2001-05-26T10:27:08Z

    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:
    --- cut ---
    proc {cmd_Functions} {} {
    global CurrentDB PgAcVar
    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
    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)
    }
    }
    setCursor DEFAULT
    }
    --- cut ---
    
    In attach. full mainlib.tcl  for PGACCESS v.0.98.7
    
  2. Re: [GENERAL] Patch for PGACCESS

    Bruce Momjian <pgman@candle.pha.pa.us> — 2001-05-30T15:09:08Z

    > 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
    
  3. Re: Re: [GENERAL] Patch for PGACCESS

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-05-30T16:23:09Z

    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
    
    
  4. Re: Re: [GENERAL] Patch for PGACCESS

    Bruce Momjian <pgman@candle.pha.pa.us> — 2001-05-30T16:53:50Z

    Good analysis, Tom.  Here is a patch for pgaccess that gets the system
    oid the _new_ way.  Funny I studied the pg_proc query but never looked
    above it to see that the system oid check was already there and this is
    a new bug.
    
    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.  There must be lots
    of version-specific pgaccess stuff so it only works with the current
    release.
    
    
    
    > 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
    > 
    
    -- 
      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
    
  5. Re: Re: [GENERAL] Patch for PGACCESS

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-05-30T17:00:02Z

    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.
    
    			regards, tom lane
    
    
  6. Re: Re: [GENERAL] Patch for PGACCESS

    Bruce Momjian <pgman@candle.pha.pa.us> — 2001-05-30T18:07:02Z

    > 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