pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to shrink database in postgresql
3+ messages / 3 participants
[nested] [flat]
* How to shrink database in postgresql
@ 2012-02-29 09:49 Rehan Saleem <pk_rehan@yahoo.com>
2012-02-29 09:56 ` Re: How to shrink database in postgresql Pavel Stehule <pavel.stehule@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Rehan Saleem @ 2012-02-29 09:49 UTC (permalink / raw)
To: pgsql-sql
hi ,
how can i shrink database in postgresql here is a MS-SQL store procedure which shrinks the database. how same task can be achieved in postgresql.
ALTER PROCEDURE [dbo].[sp_CleanUpDB]
AS
declare @db nvarchar(50)
select @db = db_name()
DBCC SHRINKDATABASE (@db, 10)
thanks
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to shrink database in postgresql
2012-02-29 09:49 How to shrink database in postgresql Rehan Saleem <pk_rehan@yahoo.com>
@ 2012-02-29 09:56 ` Pavel Stehule <pavel.stehule@gmail.com>
2012-03-02 12:29 ` Re: How to shrink database in postgresql Mario Marín <mmfmarin@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Stehule @ 2012-02-29 09:56 UTC (permalink / raw)
To: Rehan Saleem <pk_rehan@yahoo.com>; +Cc: pgsql-sql
Hello
the most similar tool in pg is "VACUUM FULL" statemet;
Regards
Pavel Stehule
2012/2/29 Rehan Saleem <pk_rehan@yahoo.com>:
> hi ,
> how can i shrink database in postgresql here is a MS-SQL store procedure
> which shrinks the database. how same task can be achieved in postgresql.
>
> ALTER PROCEDURE [dbo].[sp_CleanUpDB]
> AS
> declare @db nvarchar(50)
> select @db = db_name()
> DBCC SHRINKDATABASE (@db, 10)
>
> thanks
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to shrink database in postgresql
2012-02-29 09:49 How to shrink database in postgresql Rehan Saleem <pk_rehan@yahoo.com>
2012-02-29 09:56 ` Re: How to shrink database in postgresql Pavel Stehule <pavel.stehule@gmail.com>
@ 2012-03-02 12:29 ` Mario Marín <mmfmarin@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Mario Marín @ 2012-03-02 12:29 UTC (permalink / raw)
To: Pavel Stehule <pavel.stehule@gmail.com>; +Cc: Rehan Saleem <pk_rehan@yahoo.com>; pgsql-sql
2012/2/29 Pavel Stehule <pavel.stehule@gmail.com>:
> Hello
>
> the most similar tool in pg is "VACUUM FULL" statemet;
Hello,
From: http://wiki.postgresql.org/wiki/VACUUM_FULL "Many people, either
based on misguided advice on the 'net or on the assumption that it
must be "better", periodically run VACUUM FULL on their tables. This
is generally a really bad idea and can make your database slower not
faster", it is better to use autovacuum. Please read the wiki,
you'll find all the information you need.
Regards,
Mario Marín
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2012-03-02 12:29 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 09:49 How to shrink database in postgresql Rehan Saleem <pk_rehan@yahoo.com>
2012-02-29 09:56 ` Pavel Stehule <pavel.stehule@gmail.com>
2012-03-02 12:29 ` Mario Marín <mmfmarin@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox