473,657 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #1
5 8168
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*******@postg resql.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 PerformPortalFe tch: portal "dyncursor" not found
id: 0 nombre: fecha:
sql error PerformPortalFe tch: portal "dyncursor" not found
id: 0 nombre: fecha:
sql error PerformPortalFe tch: 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
3484
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
1572
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? Is it my database screwed up? I just created it today... I tried dropping and recreating it... and it seems to be working now. But still, if it all possible, I would appreciate any ideas as to what it could be that caused this problem in the...
10
3152
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 slow down by 10% to 15%. Other MVCC databases like MySQL InnoDB can even VACUUM discretely (runs internally). Is it my Linux system or is it PostgreSQL? The database is mostly read-only. There are 133,000 rows and each row is about 2.5kB in size...
8
4572
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 before we completed the vacuum full was 150GB. We have recently done a major update to a table, f_pageviews, in our data warehouse. The f_pageviews table contains about 118 million rows.
2
6318
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 going on it, won't it? -Q. transaction ID may wrap - no doubt here. -Q. Good news that VACUUM nowdays can run in parallel with other db activity
6
2631
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 tables (each 30-70k). This job runs 2-3 times a day; the first time mainly inserts, the 2nd, 3rd time mostly updates.
4
7939
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" ? CREATE OR REPLACE FUNCTION vacuum_all() RETURNS integer AS '
2
2524
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 were open transactions at the time the vacuum was run. These were created by having PHP running with postgresql. At least that is what I have managed to find so far. and disabling PHP in apache removes them. postgres 7588 0.0 0.4 50324 3168 ? ...
9
2740
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 time ) The one trick that i see is to try to vacuum duplicate of production database ( or just some tables ). But there are some pitfalls: http://www.postgresql.org/docs/7.4/interactive/backup-file.html
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.