Custom vacuum
This is a multi-part message in MIME format.
------=_NextPart_000_003B_01CB2821.175EC630
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
I want perform VACUUM on specific tables. This tables are result of =
query in my database (select tablename from mytablesvacuum). I tryed use =
a cursor
on function, but i receive message that vacuun can't run in function.
Any idea to do this?
tks
F=E1bio Henrique Gibon
Comex System Consultoria
------=_NextPart_000_003B_01CB2821.175EC630
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"><BASE
href=3D"file://C:\Arquivos de programas\Arquivos comuns\Microsoft =
Shared\Papel de carta\">
<STYLE></STYLE>
<META content=3D"MSHTML 6.00.2900.3132" name=3DGENERATOR></HEAD>
<BODY background=3D"">
<DIV>I want perform VACUUM on specific tables. This tables are result of =
query
in my database (select tablename from mytablesvacuum). I tryed use a =
cursor
<BR>on function, but i receive message that vacuun can't run in =
function. </DIV>
<DIV> </DIV>
<DIV>Any idea to do this?</DIV>
<DIV> </DIV>
<DIV>tks<BR>F=E1bio Henrique Gibon<BR>Comex System =
Consultoria</DIV></BODY></HTML>
------=_NextPart_000_003B_01CB2821.175EC630--
Re: Custom vacuum
--0016e6434ae0d9728f048be4c657
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
2010/7/20 F=E1bio Gibon - Comex System <gibon [at] comexsystem.com.br>
> I want perform VACUUM on specific tables. This tables are result of quer=
y
> in my database (select tablename from mytablesvacuum). I tryed use a curs=
or
> on function, but i receive message that vacuun can't run in function.
>
> Any idea to do this?
>
>
Try this:
psql -U postgres -A -t your_database_name -c "SELECT 'VACUUM
'||tablename||';' FROM mytablesvacuum" | psql -U postgres your_database_nam=
e
Best regards,
--
Fabr=EDzio de Royes Mello
>> Blog sobre TI: http://fabriziomello.blogspot.com
--0016e6434ae0d9728f048be4c657
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><div class=3D"gmail_quote">2010/7/20 F=E1bio Gibon - Comex System <span=
dir=3D"ltr"><<a href=3D"mailto:gibon [at] comexsystem.com.br">gibon [at] comexsys=
tem.com.br</a>></span><br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div>I want perform VACUUM on specific tables. This tables are result of qu=
ery
in my database (select tablename from mytablesvacuum). I tryed use a cursor=
<br>on function, but i receive message that vacuun can't run in functio=
n. </div>
<div>=A0</div>
<div>Any idea to do this?</div>
<div>=A0</div></div></blockquote></div><div><br></div>Try this:<div><br></d=
iv><div><font class=3D"Apple-style-span" face=3D"'courier new', mon=
ospace">psql -U postgres -A -t your_database_name -c "SELECT 'VACU=
UM '||tablename||';' FROM mytablesvacuum" | psql -U postgr=
es your_database_name</font></div>
<div><br></div><div><br><div>Best regards,<br>-- <br>Fabr=EDzio de Royes Me=
llo<br>>> Blog sobre TI: <a href=3D"http://fabriziomello.blogspot.com=
">http://fabriziomello.blogspot.com</a><br>
</div></div>
--0016e6434ae0d9728f048be4c657--