By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

Execute vacuum

P: n/a
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
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2

P: n/a
> > 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???
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #3

P: n/a
> 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?


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #4

P: n/a
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)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #5

P: n/a

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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.