![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
WARNING: ShmemAlloc: out of memory WARNING: Error occurred while executing PL/pgSQL function get_facility_percentiles WARNING: line 37 at execute statement ERROR: LockAcquire: lock table 1 is out of memory |
#4
| |||
| |||
|
|
I read the posts on pgsql functions and transactions from the Novice list, and I think they are saying "PGSQL functions do not support transactions". Is this correct? Or is the idea that functions are automatically in a transaction? |
#5
| |||
| |||
|
|
Can I ask you what you mean by "are you touching a whole lot of different tables in one transaction? " Do I have a transaction? Where is it? Does it start when I am at the top of the first function and end when I complete that main function? Or do I have separate transactions at the beginning and end of each subfunction? |
#6
| |||
| |||
|
|
I'm not touching a lot of different tables per se, but I have about 10 functions that each process one or more cursor that all combined end up creating about 45,000 records. The functions cascade. |
|
And like I said, I get the error on my development box with 512 M of RAM. Production has 3 G of RAM. |
|
Can I ask you what you mean by "are you touching a whole lot of different tables in one transaction? " Do I have a transaction? |
#7
| |||
| |||
|
|
Betsy Barker <betsy.barker (AT) supportservicesinc (DOT) com> writes: WARNING: ShmemAlloc: out of memory WARNING: Error occurred while executing PL/pgSQL function get_facility_percentiles WARNING: line 37 at execute statement ERROR: LockAcquire: lock table 1 is out of memory Hmm, are you touching a whole lot of different tables in one transaction? If so you may need to raise the max_locks_per_transaction parameter. If that doesn't help, we need more details about what you're doing. regards, tom lane |
#8
| |||
| |||
|
|
Betsy Barker <betsy.barker (AT) supportservicesinc (DOT) com> writes: I'm not touching a lot of different tables per se, but I have about 10 functions that each process one or more cursor that all combined end up creating about 45,000 records. The functions cascade. That doesn't in itself seem like it would require locking a lot of different tables. And like I said, I get the error on my development box with 512 M of RAM. Production has 3 G of RAM. Available RAM has nothing to do with this --- you are overflowing the lock table in PG shared memory, which is sized according to max_locks_per_transaction (times max_connections). So kicking up that parameter should fix it. I'm just curious as to why you're overflowing the default setting --- we don't see that happen all that often. |
|
Can I ask you what you mean by "are you touching a whole lot of different tables in one transaction? " Do I have a transaction? Yes, you do --- if you're using JDBC then the driver's autocommit setting determines how long the transaction lasts, but in any case it will last at least as long as one SQL statement sent to the backend. So a pile of nested functions will necessarily all execute in one transaction. If that whole process involves accessing more than a few hundred tables, you'll need to do something with max_locks_per_transaction. But if you're only accessing a few tables (say tens) then there's something else going on here. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster |
#9
| |||
| |||
|
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |