473,329 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,329 software developers and data experts.

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_transaction.

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 10044
tf*@alumni.brown.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_transaction. 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 YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2
tf*@alumni.brown.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_transaction. 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 YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3
tf*@alumni.brown.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_locks_per_transaction 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.brown.edu (Thomas F. O'Connell) writes:
Now I'm curious: why does pg_dump require that
max_connections * max_shared_locks_per_transaction 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
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...
4
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$...
6
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...
1
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...
0
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...
6
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,...
0
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...
6
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...
2
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.