Re: Temporary Table

Lists: pgsql-performance
From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
Cc: "'Alvaro Nunes Melo'" <al_nunes(at)atua(dot)com(dot)br>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Temporary Table
Date: 2005-11-08 02:10:38
Message-ID: 4370091E.8060700@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Christian Paul B. Cosinas wrote:
> I try to run this command in my linux server.
> VACUUM FULL pg_class;
> VACUUM FULL pg_attribute;
> VACUUM FULL pg_depend;
>
> But it give me the following error:
> -bash: VACUUM: command not found

That needs to be run from psql ...

>
>
>
>
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
Cc: 'Alvaro Nunes Melo' <al_nunes(at)atua(dot)com(dot)br>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Temporary Table
Date: 2005-11-08 02:14:45
Message-ID: 43700A15.9000506@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Ummm...they're SQL commands. Run them in PostgreSQL, not on the unix
command line...

Christian Paul B. Cosinas wrote:
> I try to run this command in my linux server.
> VACUUM FULL pg_class;
> VACUUM FULL pg_attribute;
> VACUUM FULL pg_depend;
>
> But it give me the following error:
> -bash: VACUUM: command not found
>
>
>
>
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org


From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
Cc: "'Joshua D(dot) Drake'" <jd(at)commandprompt(dot)com>, "'Alvaro Nunes Melo'" <al_nunes(at)atua(dot)com(dot)br>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Temporary Table
Date: 2005-11-08 02:22:54
Message-ID: Pine.LNX.4.64.0511071821490.15563@discord.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

You can use the vacuumdb external command. Here's an example:

vacuumdb --full --analyze --table mytablename mydbname

On Tue, 8 Nov 2005, Christian Paul B. Cosinas wrote:

> But How Can I put this in the Cron of my Linux Server?
> I really don't have an idea :)
> What I want to do is to loop around all the databases in my server and
> execute the vacuum of these 3 tables in each tables.
>
> -----Original Message-----
> From: Joshua D. Drake [mailto:jd(at)commandprompt(dot)com]
> Sent: Tuesday, November 08, 2005 2:11 AM
> To: Christian Paul B. Cosinas
> Cc: 'Alvaro Nunes Melo'; pgsql-performance(at)postgresql(dot)org
> Subject: Re: [PERFORM] Temporary Table
>
> Christian Paul B. Cosinas wrote:
>> I try to run this command in my linux server.
>> VACUUM FULL pg_class;
>> VACUUM FULL pg_attribute;
>> VACUUM FULL pg_depend;
>>
>> But it give me the following error:
>> -bash: VACUUM: command not found
>
> That needs to be run from psql ...
>
>>
>>
>>
>>
>>
>> I choose Polesoft Lockspam to fight spam, and you?
>> http://www.polesoft.com/refer.html
>>
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 4: Have you searched our list archives?
>>
>> http://archives.postgresql.org
>
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
Cc: "'Joshua D(dot) Drake'" <jd(at)commandprompt(dot)com>, 'Alvaro Nunes Melo' <al_nunes(at)atua(dot)com(dot)br>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Temporary Table
Date: 2005-11-08 02:24:20
Message-ID: 43700C54.2010701@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Or you could just run the 'vacuumdb' utility...

Put something like this in cron:

# Vacuum full local pgsql database
30 * * * * postgres vacuumdb -a -q -z

You really should read the manual.

Chris

Christian Paul B. Cosinas wrote:
> I see.
>
> But How Can I put this in the Cron of my Linux Server?
> I really don't have an idea :)
> What I want to do is to loop around all the databases in my server and
> execute the vacuum of these 3 tables in each tables.
>
> -----Original Message-----
> From: Joshua D. Drake [mailto:jd(at)commandprompt(dot)com]
> Sent: Tuesday, November 08, 2005 2:11 AM
> To: Christian Paul B. Cosinas
> Cc: 'Alvaro Nunes Melo'; pgsql-performance(at)postgresql(dot)org
> Subject: Re: [PERFORM] Temporary Table
>
> Christian Paul B. Cosinas wrote:
>
>>I try to run this command in my linux server.
>>VACUUM FULL pg_class;
>>VACUUM FULL pg_attribute;
>>VACUUM FULL pg_depend;
>>
>>But it give me the following error:
>> -bash: VACUUM: command not found
>
>
> That needs to be run from psql ...
>
>
>>
>>
>>
>>
>>I choose Polesoft Lockspam to fight spam, and you?
>>http://www.polesoft.com/refer.html
>>
>>
>>---------------------------(end of
>>broadcast)---------------------------
>>TIP 4: Have you searched our list archives?
>>
>> http://archives.postgresql.org
>
>
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster


From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
Cc: "'Joshua D(dot) Drake'" <jd(at)commandprompt(dot)com>, 'Alvaro Nunes Melo' <al_nunes(at)atua(dot)com(dot)br>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Temporary Table
Date: 2005-11-08 02:35:20
Message-ID: 1131417320.5555.10.camel@ubu.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

On Tue, 2005-11-08 at 10:22 +0000, Christian Paul B. Cosinas wrote:
> I see.
>
> But How Can I put this in the Cron of my Linux Server?
> I really don't have an idea :)
> What I want to do is to loop around all the databases in my server and
> execute the vacuum of these 3 tables in each tables.

I usually write a small shell script something like:

==================================================
#!/bin/sh

psql somedatabase <<EOQ
VACUUM this;
VACUUM that;
DELETE FROM someotherplace WHERE delete_this_record;
EOQ
==================================================

and so forth...

This makes the SQL quite nicely readable.

Regards,
Andrew McMillan.

-------------------------------------------------------------------------
Andrew @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)803-2201 MOB: +64(272)DEBIAN OFFICE: +64(4)499-2267
You work very hard. Don't try to think as well.
-------------------------------------------------------------------------


From: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
To: "'Alvaro Nunes Melo'" <al_nunes(at)atua(dot)com(dot)br>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Temporary Table
Date: 2005-11-08 10:09:00
Message-ID: 008301c5e44c$70eee900$1e21100a@ghwk02002147
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

I try to run this command in my linux server.
VACUUM FULL pg_class;
VACUUM FULL pg_attribute;
VACUUM FULL pg_depend;

But it give me the following error:
-bash: VACUUM: command not found

I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html


From: "Christian Paul B(dot) Cosinas" <cpc(at)cybees(dot)com>
To: "'Joshua D(dot) Drake'" <jd(at)commandprompt(dot)com>
Cc: "'Alvaro Nunes Melo'" <al_nunes(at)atua(dot)com(dot)br>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Temporary Table
Date: 2005-11-08 10:22:01
Message-ID: 008401c5e44e$42600c20$1e21100a@ghwk02002147
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

I see.

But How Can I put this in the Cron of my Linux Server?
I really don't have an idea :)
What I want to do is to loop around all the databases in my server and
execute the vacuum of these 3 tables in each tables.

-----Original Message-----
From: Joshua D. Drake [mailto:jd(at)commandprompt(dot)com]
Sent: Tuesday, November 08, 2005 2:11 AM
To: Christian Paul B. Cosinas
Cc: 'Alvaro Nunes Melo'; pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Temporary Table

Christian Paul B. Cosinas wrote:
> I try to run this command in my linux server.
> VACUUM FULL pg_class;
> VACUUM FULL pg_attribute;
> VACUUM FULL pg_depend;
>
> But it give me the following error:
> -bash: VACUUM: command not found

That needs to be run from psql ...

>
>
>
>
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html