Thread: Execute vacuum

Execute vacuum

From
Carmen Gloria Sepulveda Dedes
Date:
Hello!

Can I execute VACUUM ANALYZE from ecpg?

How I do that???

/*
I do:  EXEC SQL VACUUM ANALYZE <table>;
But I get error:  'ERROR:  VACUUM cannot run inside a transaction block'

*/

Thanks for your help.

CG


Re: Execute vacuum

From
"Magnus Naeslund(t)"
Date:
Carmen Gloria Sepulveda Dedes wrote:

> Hello!
>
> Can I execute VACUUM ANALYZE from ecpg?
>
> How I do that???
>
> /*
> I do:  EXEC SQL VACUUM ANALYZE <table>;
> But I get error:  'ERROR:  VACUUM cannot run inside a transaction block'
>
> */
>

Turn on/off autocommit maybe?
Or fake it with "EXEC SQL COMMIT; VACUUM ANALYZE" ? :)

Magnus



Re: Execute vacuum

From
Carmen Gloria Sepulveda Dedes
Date:
> > I do:  EXEC SQL VACUUM ANALYZE <table>;
> > But I get error:  'ERROR:  VACUUM cannot run inside a transaction block'
>
> Turn on/off autocommit maybe?
> Or fake it with "EXEC SQL COMMIT; VACUUM ANALYZE" ? :)

Y try with that, but it doesn't work.

Any idea???


Re: Execute vacuum

From
Carmen Gloria Sepulveda Dedes
Date:
> I think you need to enable or disable autocommit somehow.
> Or if ECPG has some function to execute the vacuum without begin/commit.
> I'm not familiar with ECPG, so i don't have any other ideas...

I set autocommit to on and off, but did not work.

I'm looking for Vacuum and ECPG in the documentation, but I don't find
anything.

I know in ECPG only I can execute sql statement with EXEC SQL ... it's
correct?




Re: Execute vacuum

From
Alvaro Herrera Munoz
Date:
On Fri, Nov 21, 2003 at 05:53:50PM -0300, Carmen Gloria Sepulveda Dedes wrote:
> > I think you need to enable or disable autocommit somehow.
> > Or if ECPG has some function to execute the vacuum without begin/commit.
> > I'm not familiar with ECPG, so i don't have any other ideas...
>
> I set autocommit to on and off, but did not work.

I think Michael said last week you could use ecpg -t to use VACUUM
with ecpg.  Not sure what other effects it has though.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Uno combate cuando es necesario... �no cuando est� de humor!
El humor es para el ganado, o para hacer el amor, o para tocar el
baliset.  No para combatir."  (Gurney Halleck)

Re: Execute vacuum

From
Carmen Gloria Sepulveda Dedes
Date:
Alvaro Herrera Munoz wrote:
> I think Michael said last week you could use ecpg -t to use VACUUM
> with ecpg.  Not sure what other effects it has though.

I tried with this, but it did not work.

Error:
....
sql error PerformPortalFetch: portal "dyncursor" not found
id:  0    nombre:      fecha:
sql error PerformPortalFetch: portal "dyncursor" not found
id:  0    nombre:      fecha:
sql error PerformPortalFetch: portal "dyncursor" not found
id:  0    nombre:      fecha:
..... loop!!!

The statement "exec sql vacuum ... "
is after of "exec sql close <cursor>"