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

Home Posts Topics Members FAQ

pg_dump out of shared memory

In using pg_dump to dump an existing postgres database, I get the
following:

pg_dump: WARNING: out of shared memory
pg_dump: attempt to lock table <table name> failed: ERROR: out of
shared memory
HINT: You may need to increase max_locks_per_t ransaction.

postgresql.conf just has the default of 1000 shared_buffers. The
database itself has thousands of tables, some of which have rows
numbering in the millions. Am I correct in thinking that, despite the
hint, it's more likely that I need to up the shared_buffers?

Or is it that pg_dump is an example of "clients that touch many
different tables in a single transaction" [from
http://www.postgresql.org/docs/7.4/s...-CONFIG-LOCKS]
and I actually ought to abide by the hint?

-tfo
Nov 23 '05 #1
4 10129
tf*@alumni.brow n.edu (Thomas F. O'Connell) writes:
In using pg_dump to dump an existing postgres database, I get the
following: pg_dump: WARNING: out of shared memory
pg_dump: attempt to lock table <table name> failed: ERROR: out of
shared memory
HINT: You may need to increase max_locks_per_t ransaction. Am I correct in thinking that, despite the
hint, it's more likely that I need to up the shared_buffers?


No.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #2
tf*@alumni.brow n.edu (Thomas F. O'Connell) writes:
In using pg_dump to dump an existing postgres database, I get the
following: pg_dump: WARNING: out of shared memory
pg_dump: attempt to lock table <table name> failed: ERROR: out of
shared memory
HINT: You may need to increase max_locks_per_t ransaction. Am I correct in thinking that, despite the
hint, it's more likely that I need to up the shared_buffers?


No.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #3
tf*@alumni.brow n.edu (Thomas F. O'Connell) wrote in message news:
postgresql.conf just has the default of 1000 shared_buffers. The
database itself has thousands of tables, some of which have rows
numbering in the millions. Am I correct in thinking that, despite the
hint, it's more likely that I need to up the shared_buffers?


So the answer here, verified by Tom Lane and my own remedy to the
problem, is "no". Now I'm curious: why does pg_dump require that
max_connections * max_shared_lock s_per_transacti on be greater than the
number of objects in the database? Or if that's not the right
assumption about how pg_dump is working, how does pg_dump obtain its
locks, and why is the error that it runs out of shared memory? Is
there a portion of shared memory that's set aside for locks? What is
the shared lock table?

-tfo
Nov 23 '05 #4
tf*@alumni.brow n.edu (Thomas F. O'Connell) writes:
Now I'm curious: why does pg_dump require that
max_connections * max_shared_lock s_per_transacti on be greater than the
number of objects in the database?


Not objects, just tables. pg_dump takes AccessShareLock (the weakest
kind of lock) on each table it intends to dump. This is basically
just to prevent someone from dropping the table underneath it. (It
would actually have to take that lock anyway as a byproduct of reading
the table contents, but we grab the locks ASAP during pg_dump startup
to reduce the risks of problems from concurrent drops.)

On a database with thousands of tables, this could easily require more
locks than the default lock table size can hold. Most normal apps don't
need more than a few tables locked within any one transaction, which is
why the table size is calculated as a multiple of max_connections .
There's a great deal of slop involved, because we pad the shared memory
size by 100K or so which is room for quite a few more lock entries than
the nominal table size ... but eventually you'll run out of room.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #5

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

Similar topics

7
4839
by: Ed L. | last post by:
We are seeing what looks like pgsql data file corruption across multiple clusters on a RAID5 partition on a single redhat linux 2.4 server running 7.3.4. System has ~20 clusters installed with a mix of 7.2.3, 7.3.2, and 7.3.4 (mostly 7.3.4), 10gb ram, 76gb on a RAID5, dual cpus, and very busy with hundreds and sometimes > 1000 simultaneous connections. After ~250 days of continuous, flawless uptime operations, we recently began...
4
3817
by: jack turer | last post by:
I have a database in pgsql (7.3.2) on redhat 9. When I try a 'pg_dump mydb' to back up the database, I get: pg_dump: could not find namespace with OID 2200 Verbose version is: -bash-2.05b$ pg_dump -v mydb | more pg_dump: saving database definition pg_dump: reading namespaces pg_dump: reading user-defined types
6
2005
by: Rory Campbell-Lange | last post by:
I think this is a suggestion/comment! pg_dump man page: --schema-only Dump only the schema (data definitions), no data I think this use of the word schema is confusing, meaning data definitions, whereas elsewhere in the man page schema are used as a namespace definition.
1
3296
by: Ben-Nes Michael | last post by:
Hello Im getting strange errors when restoring data from pg_dump files: ERROR: duplicate key violates unique constraint "products_pkey" CONTEXT: COPY products, line 1: "98 Super Pak Ruby j&aacute;t&eacute;k J-0001 1502450E Szuper Pok&eacute;mon aj&aacute;nd&eacute;kcso..." ERROR: duplicate key violates unique constraint "attributes_pkey" CONTEXT: COPY attributes, line 1: "2 Width" ERROR: duplicate key violates...
0
395
by: Thomas F. O'Connell | last post by:
In using pg_dump to dump an existing postgres database, I get the following: pg_dump: WARNING: out of shared memory pg_dump: attempt to lock table <table name> failed: ERROR: out of shared memory HINT: You may need to increase max_locks_per_transaction. postgresql.conf just has the default of 1000 shared_buffers. The database itself has thousands of tables, some of which have rows
6
11325
by: Soeren Gerlach | last post by:
Hi, some weeks ago I started to develop an application using Postgresql the first time. I'm running 7.4.3 on a Linux box with a plain 2.6.7 kernel, the storage is handled by 5 SATA disks, managed by a 3ware controller and using a xfs filesystem. The DB server is a 3 Ghz P4 with 4 Gig of Ram, so the machine is quite fast for most purposes I need it; the DB server is a pure DB server, theres no application running on it. I dump and...
0
1704
by: David Suela Fernández | last post by:
Hi! I have a debian woody with postgresql 7.4.2. When i try to use pg_dump i get the next error: pg_dump: saving encoding pg_dump: saving database definition pg_dump: SQL command failed pg_dump: Error message from server: ERROR: relation "pg_user" does not exist pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE usesysid = datdba) as dba, pg_encoding_to_char(encoding) as encoding, datpath FROM pg_database WHERE...
6
2274
by: Ilia Chipitsine | last post by:
Dear Sirs, I want to dump all databases, but separately each database in its own file, not all databases in one single file as pg_dumpall does. How can I implement that ? Cheers, Ilia Chipitsine
2
2715
by: Anony Mous | last post by:
Hi, I've seen in previous posts that recommended practice for database backup is to run the dump utility twice. Once for schema only and a second time for data only (I think). Up to know, I've only ever dumped both, and have never had a problem restoring into older/newer versions of postgres, nor with restoring into other commercial versions of postgres. This is a testament of the robustness of pg_dump! Of course, there are always a...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10439
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...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9043
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
6783
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...
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.