473,395 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Execute vacuum

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
5 8001
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
> > 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
> 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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Holger Marzen | last post by:
Hi all, the docs are not clear for me. If I want (in version 7.1.x, 7.2.x) to help the analyzer AND free unused space do I have to do a vacuum vacuum analyze or is a
1
by: Dmitry Tkach | last post by:
Hi, everybody! I am getting a weird failure, trying to vacuum a table in 7.3 - it says "ERROR: Index pg_toast_89407_index is not a btree". Does it ring a bell to anyone? Any ideas what's wrong?...
10
by: Stephen | last post by:
Hello, Is it normal for plain VACUUM on large table to degrade performance by over 9 times? My database becomes unusable when VACUUM runs. From reading newsgroups, I thought VACUUM should only...
8
by: Sean Shanny | last post by:
To all, The facts: PostgreSQL 7.4.0 running on BSD 5.1 on Dell 2650 with 4GB RAM, 5 SCSI drives in hardware RAID 0 configuration. Database size with indexes is currently 122GB. DB size...
2
by: lnd | last post by:
Any comments on multi-versioning problem: As far as I understand from PG documentation, *CURRENTLY* VACUUM must be run regulary, otherwise: -Q. database will grow as fast as there are many DML...
6
by: Alex | last post by:
Hi, just a few questions on the Vaccum I run a vacuum analyze on the database every night as part of a maintenance job. During the day I have a job that loads 30-70,000 records into two...
4
by: Ilia Chipitsine | last post by:
Dear Sirs I'm about to write plpgsql function which will "vacuum full" all existing databases. Below is an example how to get list of databases. What should I write instead of "raise notice" ?...
2
by: Russell Smith | last post by:
Postgresql 7.4.5 The following VACUUMs were run within a couple of minutes of each other completing. This table concerned is a table that has not been changed in a long time. (a month) There...
9
by: Aleksey Serba | last post by:
Hello! I have 24/7 production server under high load. I need to perform vacuum full on several tables to recover disk space / memory usage frequently ( the server must be online during vacuum...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.