Skip site navigation (1) Skip section navigation (2)

Re: Tab completion of SET TRANSACTION ISOLATION

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tab completion of SET TRANSACTION ISOLATION
Date: 2006-02-01 00:03:21
Message-ID: 200602010003.k1103L702952@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Added to TODO:

        o Prevent tab completion of SET TRANSACTION from querying the
          database and therefore preventing the transaction isolation
          level from being set.

          Currently, SET <tab> causes a database lookup to check all
          supported session variables.  This query causes problems
          because setting the transaction isolation level must be the
          first statement of a transaction.


---------------------------------------------------------------------------

Greg Stark wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> 
> > Hm, that's a bit nasty.
> > 
> > The only plan I can think of involves reading the list of available
> > variable names in advance and keeping it around.  However, I'm not
> > sure I want psql issuing such a query at connection startup whether
> > or not the info will ever be used :-(
> 
> Well, it could just lazily cache the data if it's ever fetched. That would at
> least limit the occurrence of this problem to only happening once per
> connection.
> 
> psql could also hard code "SET TRANSACTION ISOLATION" specifically. If psql
> knew that "SET TRANS" completes to SET TRANSACTION and "SET TRANSACTION I"
> completes to "SET TRANSACTION ISOLATION" it could avoid doing the query at
> all. 
> 
> That would only fail if someone uses TAB to view the available completions for
> "SET" or any shorter string. And since transaction isolation is strangely
> absent from the list of completions that seems like not such a big concern. If
> he's doing that he's not going to find it anyways.
> 
> -- 
> greg
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
> 

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

In response to

pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2006-02-01 01:15:47
Subject: Re: Tab completion of SET TRANSACTION ISOLATION
Previous:From: Jim C. NasbyDate: 2006-01-31 23:17:04
Subject: Re: Configuration WAS: New project launched : PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group