[GENERAL] Backups and binary mode

2011-08-29 Thread pasman pasmański
Hi. Is this possible to force pg_dump to make backups using COPY ... BINARY ? Simple benchmark show that COPY BINARY is 8 times faster than COPY CSV on my desktop. Postgresql 8.4.8 , WinXp sp3 pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

Re: [GENERAL] Backups and binary mode

2011-08-29 Thread pasman pasmański
> Simple benchmark show that COPY BINARY is 8 times faster > than COPY CSV on my desktop. > > I retry benchmark, and differences are small. pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/

Re: [GENERAL] Problem importing a csv file

2011-08-29 Thread Adrian Klaver
On Sunday, August 28, 2011 5:48:50 pm you wrote: > > > error is. > > > > Is the above the only command being run? Where is this coming from?: > > > > LINE 1: ...(ANALYZE off, VERBOSE off, COSTS on, BUFFERS off )... > > Explain mode, in pgadminIII > > > > Using pgsql 9.1 rc1 on Ubuntu 11.04 (Gn

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Martín Marqués
El día 26 de agosto de 2011 09:15, Merlin Moncure escribió: > 2011/8/26 Martín Marqués : >> El día 26 de agosto de 2011 00:04, Merlin Moncure >> escribió: >>> 2011/8/25 Martín Marqués : CREATE OR REPLACE FUNCTION prueba_cursor(codigo integer, curCursor refcursor)   RETURNS SETOF

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Martín Marqués
Actually, what we are trying to do is return 2 recordsets with the same function call (simulate SP from SQL Server returning 2 recordsets). I found out that I had to do PERFORM * FROM construyecursordesdequery($1, query) which works now, but can't run 2 different queries on the same cursor. I was

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Pavel Stehule
2011/8/29 Martín Marqués : > Actually, what we are trying to do is return 2 recordsets with the > same function call (simulate SP from SQL Server returning 2 > recordsets). > > I found out that I had to do PERFORM * FROM construyecursordesdequery($1, > query) > which works now, but can't run 2 dif

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Martín Marqués
El día 29 de agosto de 2011 15:28, Pavel Stehule escribió: > 2011/8/29 Martín Marqués : >> Actually, what we are trying to do is return 2 recordsets with the >> same function call (simulate SP from SQL Server returning 2 >> recordsets). >> >> I found out that I had to do PERFORM * FROM construyecu

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Pavel Stehule
2011/8/29 Martín Marqués : > El día 29 de agosto de 2011 15:28, Pavel Stehule > escribió: >> 2011/8/29 Martín Marqués : >>> Actually, what we are trying to do is return 2 recordsets with the >>> same function call (simulate SP from SQL Server returning 2 >>> recordsets). >>> >>> I found out that I

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Martín Marqués
El día 29 de agosto de 2011 15:52, Pavel Stehule escribió: > 2011/8/29 Martín Marqués : >> El día 29 de agosto de 2011 15:28, Pavel Stehule >> escribió: >>> 2011/8/29 Martín Marqués : Actually, what we are trying to do is return 2 recordsets with the same function call (simulate SP from

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Pavel Stehule
2011/8/29 Martín Marqués : > El día 29 de agosto de 2011 15:52, Pavel Stehule > escribió: >> 2011/8/29 Martín Marqués : >>> El día 29 de agosto de 2011 15:28, Pavel Stehule >>> escribió: 2011/8/29 Martín Marqués : > Actually, what we are trying to do is return 2 recordsets with the >

Re: [GENERAL] passing cursors from one PL function to another

2011-08-29 Thread Martín Marqués
El día 29 de agosto de 2011 16:12, Pavel Stehule escribió: > 2011/8/29 Martín Marqués : >>> >>> refcursors can be dynamic defined >> >> OK, I'm totally lost. How do you define a dynamic cursor? Couldn't >> find anything in the manuals. >> > > DECLARE >    curs1 refcursor; > BEGIN >  OPEN curs1 FOR

[GENERAL] dropdb: database removal failed: active sessions

2011-08-29 Thread JD Wong
Hi, I cannot dropdb. Postgres throws me: dropdb: database removal failed: ERROR: database "database1" is being accessed by other users DETAIL: There are 1 other session(s) using the database. the "select datname,current_query,query_start from pg_stat_activity ;" query gives me: datna

Re: [GENERAL] dropdb: database removal failed: active sessions

2011-08-29 Thread Guillaume Lelarge
On Mon, 2011-08-29 at 15:22 -0400, JD Wong wrote: > Hi, > > I cannot dropdb. Postgres throws me: > dropdb: database removal failed: ERROR: database "database1" is being > accessed by other users > DETAIL: There are 1 other session(s) using the database. > > the "select datname,current_query,qu

[GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
I have several Linux-x68_64 based dedicated PostgreSQL servers where I'm experiencing significant swap usage growth over time. All of them have fairly substantial amounts of RAM (not including swap), yet the amount of swap that postgres is using ramps up over time and eventually hurts performance

Re: [GENERAL] dropdb: database removal failed: active sessions

2011-08-29 Thread John R Pierce
On 08/29/11 12:22 PM, JD Wong wrote: I cannot dropdb. Postgres throws me: dropdb: database removal failed: ERROR: database "database1" is being accessed by other users DETAIL: There are 1 other session(s) using the database. the "select datname,current_query,query_start from pg_stat_activit

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Alan Hodgson
On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: > I have several Linux-x68_64 based dedicated PostgreSQL servers where > I'm experiencing significant swap usage growth over time. It's the Linux kernel that does it, not PostgreSQL. Set vm.swappiness=0 (usually in /etc/sysctl.conf) and put t

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
On Mon, Aug 29, 2011 at 1:46 PM, Alan Hodgson wrote: > On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: >> I have several Linux-x68_64 based dedicated PostgreSQL servers where >> I'm experiencing significant swap usage growth over time. > > It's the Linux kernel that does it, not PostgreSQL.

Re: [GENERAL] dropdb: database removal failed: active sessions

2011-08-29 Thread Scott Marlowe
On Mon, Aug 29, 2011 at 2:39 PM, John R Pierce wrote: > any connection to the database, even idle, will prevent a drop database. > > try... > >    select pg_terminate_backend(procpid) from pg_stat_activity where datname > = 'database1'; > > that will snuff those processes.  then you can drop the d

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Scott Marlowe
On Mon, Aug 29, 2011 at 2:57 PM, Lonni J Friedman wrote: > On Mon, Aug 29, 2011 at 1:46 PM, Alan Hodgson wrote: >> On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: >>> I have several Linux-x68_64 based dedicated PostgreSQL servers where >>> I'm experiencing significant swap usage growth ove

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Merlin Moncure
On Mon, Aug 29, 2011 at 3:46 PM, Alan Hodgson wrote: > On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: >> I have several Linux-x68_64 based dedicated PostgreSQL servers where >> I'm experiencing significant swap usage growth over time. > > It's the Linux kernel that does it, not PostgreSQL.

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Merlin Moncure
On Mon, Aug 29, 2011 at 3:36 PM, Lonni J Friedman wrote: > I have several Linux-x68_64 based dedicated PostgreSQL servers where > I'm experiencing significant swap usage growth over time.  All of them > have fairly substantial amounts of RAM (not including swap), yet the > amount of swap that post

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
On Mon, Aug 29, 2011 at 2:24 PM, Scott Marlowe wrote: > On Mon, Aug 29, 2011 at 2:57 PM, Lonni J Friedman wrote: >> On Mon, Aug 29, 2011 at 1:46 PM, Alan Hodgson wrote: >>> On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: I have several Linux-x68_64 based dedicated PostgreSQL servers

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
On Mon, Aug 29, 2011 at 2:38 PM, Merlin Moncure wrote: > On Mon, Aug 29, 2011 at 3:36 PM, Lonni J Friedman wrote: >> I have several Linux-x68_64 based dedicated PostgreSQL servers where >> I'm experiencing significant swap usage growth over time.  All of them >> have fairly substantial amounts of

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Scott Marlowe
On Mon, Aug 29, 2011 at 3:38 PM, Lonni J Friedman wrote: > On Mon, Aug 29, 2011 at 2:24 PM, Scott Marlowe > wrote: >> On Mon, Aug 29, 2011 at 2:57 PM, Lonni J Friedman wrote: >>> On Mon, Aug 29, 2011 at 1:46 PM, Alan Hodgson wrote: On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: >>

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
On Mon, Aug 29, 2011 at 2:51 PM, Scott Marlowe wrote: > On Mon, Aug 29, 2011 at 3:38 PM, Lonni J Friedman wrote: >> On Mon, Aug 29, 2011 at 2:24 PM, Scott Marlowe >> wrote: >>> On Mon, Aug 29, 2011 at 2:57 PM, Lonni J Friedman >>> wrote: On Mon, Aug 29, 2011 at 1:46 PM, Alan Hodgson wro

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Merlin Moncure
On Mon, Aug 29, 2011 at 4:45 PM, Lonni J Friedman wrote: >> using any C code in the backend? this includes 3rd party libraries >> which link in C, including postgis, pljava, xml2, etc.  Any features >> being used not included in the standard core distribution are >> interesting. > > Nope, nothing

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
On Mon, Aug 29, 2011 at 3:17 PM, Merlin Moncure wrote: > On Mon, Aug 29, 2011 at 4:45 PM, Lonni J Friedman wrote: >>> using any C code in the backend? this includes 3rd party libraries >>> which link in C, including postgis, pljava, xml2, etc.  Any features >>> being used not included in the stan

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Alan Hodgson
On August 29, 2011 02:34:26 PM you wrote: > On Mon, Aug 29, 2011 at 3:46 PM, Alan Hodgson wrote: > > On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: > >> I have several Linux-x68_64 based dedicated PostgreSQL servers where > >> I'm experiencing significant swap usage growth over time. > >

Re: [GENERAL] Indexes on inheriting tables

2011-08-29 Thread Scott Mead
2011/8/24 Ondrej Ivanič > Hi, > > On 25 August 2011 11:17, Toby Corkindale > wrote: > > Do I need to make sure I re-create every index on every child table I > > create? > > That would be.. annoying, at best. > > Yes, it is little bit annoying but I like it. You don't need any index > on parent

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Tom Lane
Lonni J Friedman writes: > I have several Linux-x68_64 based dedicated PostgreSQL servers where > I'm experiencing significant swap usage growth over time. All of them > have fairly substantial amounts of RAM (not including swap), yet the > amount of swap that postgres is using ramps up over time

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Lonni J Friedman
On Mon, Aug 29, 2011 at 5:42 PM, Tom Lane wrote: > Lonni J Friedman writes: >> I have several Linux-x68_64 based dedicated PostgreSQL servers where >> I'm experiencing significant swap usage growth over time.  All of them >> have fairly substantial amounts of RAM (not including swap), yet the >>

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread peixubin
You should monitor PageTables value in /proc/meminfo.if the value larger than 1G,I Suggest enable hugepages . To monitor PageTables: # cat /proc/meminfo |grep -i pagetables -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Scott Marlowe
On Mon, Aug 29, 2011 at 5:01 PM, Alan Hodgson wrote: > On August 29, 2011 02:34:26 PM you wrote: >> On Mon, Aug 29, 2011 at 3:46 PM, Alan Hodgson wrote: >> > On August 29, 2011 01:36:07 PM Lonni J Friedman wrote: >> >> I have several Linux-x68_64 based dedicated PostgreSQL servers where >> >> I'm

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Greg Smith
On 08/29/2011 06:12 PM, Lonni J Friedman wrote: OK, I'll reduce it to 10GB and see if there's any noticable change in performance. thanks I've never heard a report of a Linux system using more than 8GB of shared_buffers usefully, and peak performance on systems I've tested has sometimes

[GENERAL] Enable PITR in Postgresql

2011-08-29 Thread Adarsh Sharma
Dear all, Today I need to enable PITR in my Postgres Production Server. I followed the below links for this purpose : http://scale-out-blog.blogspot.com/2009/02/simple-ha-with-postgresql-point-in-time.html http://www.postgresql.org/docs/8.3/static/continuous-archiving.html But I am confused abo

Re: [GENERAL] Enable PITR in Postgresql

2011-08-29 Thread John R Pierce
On 08/29/11 10:53 PM, Adarsh Sharma wrote: Now do we need to change the below command each time new log file is created or there is some standard way to do that. |archive_command = 'cp -v %p /data/pgsql/archives/%f'| %p and %f automatically get replaced with the name of the logfile being arc

Re: [GENERAL] heavy swapping, not sure why

2011-08-29 Thread Florian Weimer
* Scott Marlowe: > On a machine with lots of memory, I've run into pathological behaviour > with both the RHEL 5 and Ubuntu 10.04 kernels where the kswapd starts > eating up CPU and swap io like mad, while doing essentially nothing. > Setting swappiness to 0 delayed this behaviour but did not stop