473,795 Members | 3,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PostgreSQL seems to wait and block all the queries

HM
Hello !

-----------------------------------------------------------------------------
I would like to know why the database seems frozen.

- psql can access to database on the database server
- There are no error logs. There are only normal logs
- pgadmin cannot connect to the database.
- the webserver cannot execute any script
- other PHP scripts are waiting.

A lock seems to block all the database.
I've left the database as it is. I installed the database on an other
server to check the hardware of the old server.

IN ADVANCE THANK YOU !
-------------------------------------------------------------------------------

PostgreSQL 7.4.5 with "connect by" patch
Debian linux woody

The database is waiting and seems frozen.

1790 ? S 0:00 postgres: database database 192.168.1.8
SELECT
1791 ? S 0:00 postgres: database database 192.168.1.8
SELECT
1794 ? S 0:00 postgres: database database 192.168.1.8
SELECT
5559 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting
5980 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting
13449 ? S 0:00 postgres: database database 192.168.1.8
SELECT
18255 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting
18313 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting
29331 ? S 0:00 /USR/SBIN/CRON
29334 ? S 0:00 /bin/sh /script_vacuum
29337 ? S 0:00 /usr/sbin/sendmail -i -FCronDaemon -odi
-oem postgres
29339 ? S 0:00 /usr/bin/vacuumdb -z -f -v -U postgres
database
29340 ? S 0:00 /usr/sbin/postdrop -r
29341 ? S 0:00 postgres: postgres database [local] VACUUM
waiting
29350 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting
29358 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting
29362 ? S 0:00 postgres: database database 192.168.1.8
SELECT waiting

.... A lot of SELECT OR UPDATE waiting ...

Here is the result of select * from pg_stat_activit y

datid | datname | procpid | usesysid | usename | current_query |
query_start
----------+----------+---------+----------+----------+----------------------------------------------------------------------
12777577 | database | 1790 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
18:00:55.032409 +02
12777577 | database | 1791 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
18:00:56.185738 +02
12777577 | database | 1794 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
18:01:01.294875 +02
12777577 | database | 5559 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
18:47:38.033507 +02
12777577 | database | 5980 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
18:52:08.089988 +02
12777577 | database | 13449 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
20:51:12.717093 +02
12777577 | database | 18255 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
22:08:17.587026 +02
12777577 | database | 18313 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-05
22:09:07.963451 +02
12777577 | database | 29350 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-06
04:15:09.556203 +02
12777577 | database | 29358 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-06
04:15:22.681887 +02
12777577 | database | 29362 | 100 | database | SELECT
price(ID) AS price FROM PRODUCTS WHERE ID=1 | 2004-10-06
04:15:27.485337 +02

The problem happened at 04:15 AM during a vacuum FULL and could occurs
at every moment

Here is the result of select * from pglocks

relation | database | transaction | pid | mode |
granted
----------+----------+-------------+-------+------------------+---------
12777689 | 12777577 | | 1790 | AccessShareLock | t
20633160 | 12777577 | | 1790 | AccessShareLock | t
12777668 | 12777577 | | 1790 | AccessShareLock | t
| | 229273687 | 1790 | ExclusiveLock | t
12777773 | 12777577 | | 1790 | AccessShareLock | t
12777773 | 12777577 | | 1790 | RowExclusiveLoc k | t
12777689 | 12777577 | | 1791 | AccessShareLock | t
12777668 | 12777577 | | 1791 | AccessShareLock | t
20633160 | 12777577 | | 1791 | AccessShareLock | t
12777773 | 12777577 | | 1791 | AccessShareLock | t
12777773 | 12777577 | | 1791 | RowExclusiveLoc k | t
| | 229273691 | 1791 | ExclusiveLock | t
| | 229273699 | 1794 | ExclusiveLock | t
12777773 | 12777577 | | 1794 | AccessShareLock | t
12777773 | 12777577 | | 1794 | RowExclusiveLoc k | t
20633160 | 12777577 | | 1794 | AccessShareLock | t
12777689 | 12777577 | | 1794 | AccessShareLock | t
12777668 | 12777577 | | 1794 | AccessShareLock | t
12777689 | 12777577 | | 13449 | AccessShareLock | t
12777773 | 12777577 | | 13449 | AccessShareLock | t
12777773 | 12777577 | | 13449 | RowExclusiveLoc k | t
12777668 | 12777577 | | 13449 | AccessShareLock | t
| | 229354045 | 13449 | ExclusiveLock | t
20633160 | 12777577 | | 13449 | AccessShareLock | t
I would like to know if these functions and queries could cause
problems to postgresql.

This is a SELECT query of a field which is updated by a function in
the same query.

Example :

SELECT price(ID) AS price FROM PRODUCTS WHERE ID=1

function price(ID) - PL/SQL Function
{
IF TEST THEN RETURN get_price(ID)
}

function get_price(ID) - PL/Python
{
exec \'from urllib2 import *\' in globals(), locals()
url = "http://www.toto.com"
fichier = urlopen(url)

--
-- PARSE XML RETURNED BY toto.com
-- value = arbre.getElemen tsByTagName("te st")[0].firstChild.dat a
--

UPDATE PRODUCTS SET price = value WHERE id=1

RETURN Value
}
Nov 23 '05 #1
3 8736
HM wrote:
I would like to know why the database seems frozen.
...
The problem happened at 04:15 AM during a vacuum FULL and could occurs
at every moment


VACUUM FULL locks your tables.
Nov 23 '05 #2
HM
Hello !

Thank you for your answer.

VACUUM FULL maybe lock tables but don't release them. It seems waits
an the release of an other lock in the database "database".
The database still frozen at this moment (2 days).

Here is a sample of VACUUM log
1 INFO: vacuuming "information_sc hema.sql_featur es"
2 INFO: "sql_featur es": found 0 removable, 360 nonremovable row
versions in 5 pages
3 DETAIL: 0 dead row versions cannot be removed yet.
4 Nonremovable row versions range from 68 to 208 bytes long.

....

796 INFO: index "pg_toast_16384 _index" now contains 0 row versions in
1 pages
797 DETAIL: 0 index pages have been deleted, 0 are currently
reusable.
798 CPU 0.00s/0.00u sec elapsed 0.00 sec.
799 INFO: analyzing "pg_catalog.pg_ attrdef"
800 INFO: "pg_attrdef ": 4 pages, 63 rows sampled, 63 estimated total
rows

no more log from VACUUM

In the normal operation vaccum logs 2700 lines including vacuum log of
the database "database".

Bye

HM
William Yu <wy*@talisys.co m> wrote in message news:<ck******* ***@news.hub.or g>...
HM wrote:
I would like to know why the database seems frozen.
> ...
The problem happened at 04:15 AM during a vacuum FULL and could occurs
at every moment


VACUUM FULL locks your tables.

Nov 23 '05 #3
HM
Hello !

Thank you for your answer.

VACUUM FULL maybe lock tables but don't release them. It seems waits
an the release of an other lock in the database "database".
The database still frozen at this moment (2 days).

Here is a sample of VACUUM log
1 INFO: vacuuming "information_sc hema.sql_featur es"
2 INFO: "sql_featur es": found 0 removable, 360 nonremovable row
versions in 5 pages
3 DETAIL: 0 dead row versions cannot be removed yet.
4 Nonremovable row versions range from 68 to 208 bytes long.

....

796 INFO: index "pg_toast_16384 _index" now contains 0 row versions in
1 pages
797 DETAIL: 0 index pages have been deleted, 0 are currently
reusable.
798 CPU 0.00s/0.00u sec elapsed 0.00 sec.
799 INFO: analyzing "pg_catalog.pg_ attrdef"
800 INFO: "pg_attrdef ": 4 pages, 63 rows sampled, 63 estimated total
rows

no more log from VACUUM

In the normal operation vaccum logs 2700 lines including vacuum log of
the database "database".

Bye

HM
William Yu <wy*@talisys.co m> wrote in message news:<ck******* ***@news.hub.or g>...
HM wrote:
I would like to know why the database seems frozen.
> ...
The problem happened at 04:15 AM during a vacuum FULL and could occurs
at every moment


VACUUM FULL locks your tables.

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5068
by: Saleh, Amgad H | last post by:
The default block size which represents the page size is 8192 defined in pg_config.h.in. I've been trying to increase that to 16384 and rebuild postgreSQL. I was able to build it and it showed 16384 in the built pg_config.h. After installation and use initdb, the pagesize is still the default 8192. Any add'l config. procedure needed.
74
8058
by: John Wells | last post by:
Yes, I know you've seen the above subject before, so please be gentle with the flamethrowers. I'm preparing to enter a discussion with management at my company regarding going forward as either a MySql shop or a Postgresql shop. It's my opinion that we should be using PG, because of the full ACID support, and the license involved. A consultant my company hired before bringing me in is pushing hard for MySql, citing speed and community...
44
4575
by: Greg Strong | last post by:
Hello All, Is it better to create a query in DAO where a report has 4 sub-reports each of whose record source is a query created at runtime and everything is in 1 MDB file? From what I've read and experienced it appears DAO is the way to go in this situation, so when is it good to use ADOX to create queries? Why do I ask the question? I've created a MDB file which uses DAO, but
0
1550
by: Jerry LeVan | last post by:
Here is how I spent the last couple of days... Using aqua tcl/tk with postgresql seems to take a bit of extra work. With clues from Dan Steffen, I think I have it working... Here is the contents of my postgresql config command: ../configure --bindir=/usr/local/bin --mandir=/usr/local/share/man \
0
1510
by: Mark Harrison | last post by:
HOWTO: Integrating Posgresql queries into an event loop. Mark Harrison mh@pixar.com May 27, 2004 Problem ------- The commonly used postgresql APIs will block until completed.
8
4168
by: Kaarel | last post by:
Would PostgreSQL be a good enough choise for GnuCash (or Quickbooks or the likes) type of program? What could be the potential drawbacks of using PostgreSQL (perhaps its big size)? What would be a better database for that kind of job? Kaarel ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your
5
12866
by: Micha³ Gancarski | last post by:
Hello! How do one unescape strings prepared with pg_escape_string() ? stripslashes() will not work because both these functions are not completely compatible. Thank you all in advance -- Micha³ Gancarski
14
2611
by: jptpjs via AccessMonster.com | last post by:
I have an application I built in Access 2003. It is an electronic medical records program split into front end (8 computers) and back end. This runs flawlessly. Purchased a billing program that uses Postgresql. This resides on the same computer as our Access backend. We keep getting knocked out of the new billing program and never get knocked out of my Access program. The billing software provider says that Access and Postgresql running...
10
7407
by: Hendrik van Rooyen | last post by:
While doing a netstring implementation I noticed that if you build a record up using socket's recv(1), then when you close the remote end down, the recv(1) hangs, despite having a short time out of 0.1 set. If however, you try to receive more than one char, (I tested with 3, did not try 2), then when you shut the remote end down you do not get a time out, but an empty string - the normal end of file, I suppose. Has anybody else seen...
0
9672
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
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
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
9042
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...
0
6780
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
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
3
2920
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.