Bruce Momjian wrote:
> Tom Lane wrote:
> > I tried to repeat this:
> > 
> > regression=# begin;
> > BEGIN
> > regression=# create table foo (f1 int);
> > CREATE
> > regression=# insert into foo [ ... some data ... ]
> > 
> > regression=# analyze foo;
> > ERROR:  ANALYZE cannot run inside a BEGIN/END block
> > 
> > This seems a tad silly; I can't see any reason why ANALYZE couldn't be
> > done inside a BEGIN block.  I think this is just a hangover from
> > ANALYZE's origins as part of VACUUM.  Can anyone see a reason not to
> > allow it?
> 
> The following patch allows analyze to be run inside a transaction.  
> Vacuum and vacuum analyze still can not be run in a transaction.

One change in this patch is that because analyze now runs in the outer
transaction, I can't clear the memory used to support each analyzed
relation.  Not sure if this is an issue.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to