niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » PostgreSQL
psql seems to hang during delete query
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
Surabhi Ahuja
*nix forums Guru Wannabe


Joined: 03 Mar 2005
Posts: 110

PostPosted: Thu Jul 20, 2006 6:00 am    Post subject: psql seems to hang during delete query Reply with quote

i am using postgresql 8.0.0

my disk is 100% full

i have a database called x

i do the following
psql x
delete from table;


nothing happens

i try to see the top output

i see the following
1768 sdc 25 0 41860 32m 30m R 99.7 0.8 11:29.35 postmaster
i also saw this appearing

2525 root 16 0 7296 720 620 S 0.3 0.0 0:07.62 hald-addon-stor


its been almost half an hour
and the database is still in the same state. (all the rows still exist)

what is happening?
hasnt it started deleteing yet?
postgreslog dont say anything.

what can be done in such a case?
thanks,
regards
Surabhi
Back to top
Harald Armin Massa
*nix forums addict


Joined: 05 Jul 2005
Posts: 61

PostPosted: Thu Jul 20, 2006 6:46 am    Post subject: Re: psql seems to hang during delete query Reply with quote

You can't delete from a full disk :)

No, really: database systems need space for logging, WAL, whatever.

And even with "delete" PostgreSQL will free no single byte, as deleting is
done with marking the row as deleted. Read up on multi version concurrency
why this has to be that way.

To reclaim space: vacuum freeze

So, to get space, you have to have space first. Delete something else.

Harald

On 7/20/06, surabhi.ahuja <surabhi.ahuja@iiitb.ac.in> wrote:
Quote:

i am using postgresql 8.0.0

my disk is 100% full

i have a database called x

i do the following
psql x
delete from table;


nothing happens

i try to see the top output

i see the following
1768 sdc 25 0 41860 32m 30m R 99.7 0.8 11:29.35 postmaster
i also saw this appearing

2525 root 16 0 7296 720 620 S 0.3 0.0 0:07.62hald-addon-stor

its been almost half an hour
and the database is still in the same state. (all the rows still exist)

what is happening?
hasnt it started deleteing yet?
postgreslog dont say anything.

what can be done in such a case?
thanks,
regards
Surabhi




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
on different matter:
EuroPython 2006 is over. It was a GREAT conference. If you missed it, now
you can prepare budget for visiting EuroPython 2007.
Back to top
Surabhi Ahuja
*nix forums Guru Wannabe


Joined: 03 Mar 2005
Posts: 110

PostPosted: Thu Jul 20, 2006 7:20 am    Post subject: Re: psql seems to hang during delete query Reply with quote

so how much space should be free so that i am able to delete

i have a hard disk of size 130 G.


thanks,
regards
Surabhi

________________________________

From: Harald Armin Massa [mailto:haraldarminmassa@gmail.com]
Sent: Thu 7/20/2006 12:16 PM
To: surabhi.ahuja
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] psql seems to hang during delete query


***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********


You can't delete from a full disk :)

No, really: database systems need space for logging, WAL, whatever.

And even with "delete" PostgreSQL will free no single byte, as deleting is done with marking the row as deleted. Read up on multi version concurrency why this has to be that way.

To reclaim space: vacuum freeze

So, to get space, you have to have space first. Delete something else.

Harald


On 7/20/06, surabhi.ahuja <surabhi.ahuja@iiitb.ac.in> wrote:

i am using postgresql 8.0.0

my disk is 100% full

i have a database called x

i do the following
psql x
delete from table;


nothing happens

i try to see the top output

i see the following
1768 sdc 25 0 41860 32m 30m R 99.7 0.8 11:29.35 postmaster
i also saw this appearing

2525 root 16 0 7296 720 620 S 0.3 0.0 0:07.62 hald-addon-stor


its been almost half an hour
and the database is still in the same state. (all the rows still exist)

what is happening?
hasnt it started deleteing yet?
postgreslog dont say anything.

what can be done in such a case?
thanks,
regards
Surabhi




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
on different matter:
EuroPython 2006 is over. It was a GREAT conference. If you missed it, now you can prepare budget for visiting EuroPython 2007.
Back to top
Sven Willenberger
*nix forums beginner


Joined: 15 Mar 2005
Posts: 49

PostPosted: Thu Jul 20, 2006 2:13 pm    Post subject: Re: psql seems to hang during delete query Reply with quote

On Thu, 2006-07-20 at 12:48 +0530, surabhi.ahuja wrote:
Quote:
so how much space should be free so that i am able to delete

i have a hard disk of size 130 G.


thanks,
regards
Surabhi


______________________________________________________________________
If you are trying to delete the entire contents of a table (and are not

using slony replication or similar) then a simple TRUNCATE <tablename>
will achieve the desired result and free up some diskspace.
Alternatively, if you have indexes on the table, you could try to drop
the indexes (if they are bloated, you can probably regain some diskspace
that way). Delete the rows you need and then create the indexes anew.

Sven


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 6:13 pm | All times are GMT
navigation Forum index » Databases » PostgreSQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Very slow query Michael Sutter MySQL 0 Fri Jul 21, 2006 1:10 pm
No new posts container for insert/delete + fast index Neal Becker C++ 1 Fri Jul 21, 2006 12:57 pm
No new posts 2 USB webcams on Linux 2.6.15.4 produce a hang Suyog hardware 1 Fri Jul 21, 2006 7:27 am
No new posts Column info without executing query Dan Strömberg PostgreSQL 10 Thu Jul 20, 2006 6:21 pm
No new posts recursive query Jürg Schaufelberger Server 1 Thu Jul 20, 2006 6:06 pm

Loans | Free Ringtones | Quick Collect | Mortgage | Mortgage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1581s ][ Queries: 16 (0.0724s) ][ GZIP on - Debug on ]