Execute vacuum

Started by Carmen Gloria Sepulveda Dedesover 22 years ago6 messagesgeneral
Jump to latest
#1Carmen Gloria Sepulveda Dedes
csepulveda@atichile.com

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

In reply to: Carmen Gloria Sepulveda Dedes (#1)
Re: Execute vacuum

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

#3Carmen Gloria Sepulveda Dedes
csepulveda@atichile.com
In reply to: Carmen Gloria Sepulveda Dedes (#1)
Re: Execute vacuum

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???

#4Carmen Gloria Sepulveda Dedes
csepulveda@atichile.com
In reply to: Carmen Gloria Sepulveda Dedes (#1)
Re: Execute vacuum

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?

#5Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Carmen Gloria Sepulveda Dedes (#4)
Re: Execute vacuum

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)

#6Carmen Gloria Sepulveda Dedes
csepulveda@atichile.com
In reply to: Alvaro Herrera (#5)
Re: Execute vacuum

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>"