Re: [GENERAL] Foreign Keys and Deadlocks

2011-11-09 Thread Alvaro Herrera
Excerpts from David Kerr's message of vie nov 04 13:01:29 -0300 2011: > I did more digging and found some good discussions on the subject in general, > but > most of the examples out there contain explicit updates (which is why i was > confused) > but it looks like it's being addressed. > >

[GENERAL] DB Dump

2011-11-09 Thread Bob Pawley
Hi PostgreSQL v9.0 Win 7 I am using the following to dump a database. I get an error – “could not open output file “.backup”. Permission denied.” To me, this sounds as if I am required to create an output file in order to get an output file. In previous versions the output file was c

[GENERAL] Create Tables As Specific Role

2011-11-09 Thread Carlos Mennens
I'm installing a calendar application called MRBS. The installation instructions require I create a role and database specifically for this web application. I'm currenlt logged in as my user account 'carlos' which is a superuser. postgres=# SELECT current_user; current_user -- carlos

Re: [GENERAL] DB Dump

2011-11-09 Thread Guillaume Lelarge
On Wed, 2011-11-09 at 08:58 -0800, Bob Pawley wrote: > Hi > > PostgreSQL v9.0 > Win 7 > > I am using the following to dump a database. > > I get an error – “could not open output file “.backup”. Permission > denied.” > > To me, this sounds as if I am required to create an output file i

Re: [GENERAL] Create Tables As Specific Role

2011-11-09 Thread Guillaume Lelarge
On Wed, 2011-11-09 at 12:20 -0500, Carlos Mennens wrote: > I'm installing a calendar application called MRBS. The installation > instructions require I create a role and database specifically for > this web application. I'm currenlt logged in as my user account > 'carlos' which is a superuser. > >

Re: [GENERAL] Foreign Keys and Deadlocks

2011-11-09 Thread David Kerr
On Wed, Nov 09, 2011 at 11:11:23AM -0300, Alvaro Herrera wrote: - - Excerpts from David Kerr's message of vie nov 04 13:01:29 -0300 2011: - - > I did more digging and found some good discussions on the subject in general, but - > most of the examples out there contain explicit updates (which is

Re: [GENERAL] DB Dump

2011-11-09 Thread Bob Pawley
The file doesn't exist. Just in case, I modified the dump to pg_dump -h localhost -p 5432 -U postgres -v -f "PDW2_cp_Nov_2011.backup" PDW and got the same error. Bob -Original Message- From: Guillaume Lelarge Sent: Wednesday, November 09, 2011 9:48 AM To: Bob Pawley Cc: Postgresql S

Re: [GENERAL] DB Dump

2011-11-09 Thread Bob Pawley
Following is a copy of the end of running the dump - pg_dump: saving standard_conforming_strings = off pg_dump: saving database definition pg_dump: [archiver] could not open output file "PDW_cp_Nov_2011.backup": Permiss ion denied pg_dump: *** aborted because of error Bob -Original Messag

Re: [GENERAL] DB Dump

2011-11-09 Thread Adrian Klaver
On 11/09/2011 09:58 AM, Bob Pawley wrote: Following is a copy of the end of running the dump - pg_dump: saving standard_conforming_strings = off pg_dump: saving database definition pg_dump: [archiver] could not open output file "PDW_cp_Nov_2011.backup": Permiss ion denied pg_dump: *** aborted be

Re: [GENERAL] DB Dump

2011-11-09 Thread Bob Pawley
I'm logged on to my computer as an administrator(and am the only user). What other permission do I need?? Bob -Original Message- From: Adrian Klaver Sent: Wednesday, November 09, 2011 10:00 AM To: Bob Pawley Cc: Guillaume Lelarge ; Postgresql Subject: Re: [GENERAL] DB Dump On 11/09/2

Re: [GENERAL] DB Dump

2011-11-09 Thread Raymond O'Donnell
On 09/11/2011 17:53, Bob Pawley wrote: The file doesn't exist. Just in case, I modified the dump to pg_dump -h localhost -p 5432 -U postgres -v -f "PDW2_cp_Nov_2011.backup" PDW and got the same error. Hi Bob, It sounds as if (as Guillaume suggested) the OS user you're working under doesn't

[GENERAL] connections and cpu consumption

2011-11-09 Thread Gauthier, Dave
Hi: PG v4.8.3 on Linux I'm using "selcet procpid,current_query from pg_stat_activity" to monitor activity during times when "top" is showing many PG procs with very high cpu usage numbers (all cores at or above 90%). Some of these are procs that map to PG connections with current_query = . W

Re: [GENERAL] DB Dump

2011-11-09 Thread Raymond O'Donnell
On 09/11/2011 18:05, Bob Pawley wrote: I'm logged on to my computer as an administrator(and am the only user). What other permission do I need?? Well, does the administrator have write permission to the directory? Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@iol.ie -- Sent via pgsql

Re: [GENERAL] DB Dump

2011-11-09 Thread Bob Pawley
Opening Command Prompt as administrator solved my problem. Thanks everybody. Bob -Original Message- From: Raymond O'Donnell Sent: Wednesday, November 09, 2011 10:41 AM To: Bob Pawley Cc: Adrian Klaver ; Guillaume Lelarge ; Postgresql Subject: Re: [GENERAL] DB Dump On 09/11/2011

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread John R Pierce
On 11/09/11 10:35 AM, Gauthier, Dave wrote: I'm using "selcet procpid,current_query from pg_stat_activity" to monitor activity during times when "top" is showing many PG procs with very high cpu usage numbers (all cores at or above 90%). Some of these are procs that map to PG connections wit

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread Magnus Hagander
On Wednesday, November 9, 2011, Gauthier, Dave wrote: > Hi: > > ** ** > > PG v4.8.3 on Linux > > ** ** > > I'm using "selcet procpid,current_query from pg_stat_activity" to monitor > activity during times when "top" is showing many PG procs with very high > cpu usage numbers (all cores at

Re: [GENERAL] DB Dump

2011-11-09 Thread John R Pierce
On 11/09/11 11:09 AM, Bob Pawley wrote: Opening Command Prompt as administrator solved my problem. thats a terrible solution. rather, you should be writing your backups to a directory that the current user has permissions to write to. or if the directory you're using is specifically the one

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread Gauthier, Dave
A... so if the script that has the connection open would only terminate the transaction, then vacuum wouldn't get behind? I actually made a change in that script to rollback when the script doesn't need the changes in the transaction, hopefully allowing vacuum to do its thing. Thanks!

[GENERAL] Insufficient privilege when initiating backup

2011-11-09 Thread Cody Caughlan
I am attempting to run select pg_start_backup('backup-2011-11-09'); But it is just hanging, I've given it 3 minutes. When I view pg_stat_activity I see "" in the current_query column. I've quadruple checked that the user (postgres) has the Replication role: batch_api_production=> \du+

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread John R Pierce
On 11/09/11 11:35 AM, Gauthier, Dave wrote: A... so if the script that has the connection open would only terminate the transaction, then vacuum wouldn't get behind? I actually made a change in that script to rollback when the script doesn't need the changes in the transaction, hopefully a

Re: [GENERAL] Insufficient privilege when initiating backup

2011-11-09 Thread Guillaume Lelarge
On Wed, 2011-11-09 at 11:48 -0800, Cody Caughlan wrote: > I am attempting to run > > select pg_start_backup('backup-2011-11-09'); > > But it is just hanging, I've given it 3 minutes. When I view > pg_stat_activity I see "" in the current_query > column. > > I've quadruple checked that the user (

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread Gauthier, Dave
ALas, there is no "application_name" column in that table. But I do like the "now()-xact_start" ! -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: Wednesday, November 09, 2011 2:58 PM To: pgsql-gene

[GENERAL] Why does autovacuum run in so small blocks?

2011-11-09 Thread hubert depesz lubaczewski
hi, I have strange situation with one table. base info: pg 8.4.8 here is info from pg_stat_all_tables about i: now | relid | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | last_autovacuum ---+---+

Re: [GENERAL] Why does autovacuum run in so small blocks?

2011-11-09 Thread Bill Moran
In response to hubert depesz lubaczewski : > hi, > I have strange situation with one table. > > base info: pg 8.4.8 > > here is info from pg_stat_all_tables about i: > now | relid | n_tup_ins | n_tup_upd | n_tup_del | > n_tup_hot_upd | n_live_tup | n_dead_tup |

Re: [GENERAL] Why does autovacuum run in so small blocks?

2011-11-09 Thread hubert depesz lubaczewski
On Wed, Nov 09, 2011 at 04:37:50PM -0500, Bill Moran wrote: > My guess would be that the vacuum was triggered by updates, but there were > active transactions that prevented vacuum from cleaning up the dead tuples, > so it came back later and was able to clean them up at that time. > > Would need

Re: [GENERAL] Foreign Keys and Deadlocks

2011-11-09 Thread Alvaro Herrera
Excerpts from David Kerr's message of mié nov 09 14:52:01 -0300 2011: > On Wed, Nov 09, 2011 at 11:11:23AM -0300, Alvaro Herrera wrote: > - This case is not helped by the patch I'm working on. As far as I can > - see, if you got rid of the PK in table a in your example script, things > - should

[GENERAL] SIGNALNAME in "pg_ctl kill"

2011-11-09 Thread Gauthier, Dave
pg_ctl --help lists the various SIGNALNAME options to use with "pg_ctk kill"... Allowed signal names for kill: HUP INT QUIT ABRT TERM USR1 USR2 I can't find a description of what each does. I'd like to abort just the procpid I enter, but using ABRT has a tendancy to kill lots of other stuff t

Re: [GENERAL] SIGNALNAME in "pg_ctl kill"

2011-11-09 Thread Mike Blackwell
The manual section on the postmaster process has some info: http://www.postgresql.org/docs/current/static/app-postgres.html __ *Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnell

[GENERAL] Weird waste time when UNION ALL to an empty result set

2011-11-09 Thread Emanuel Calvo
Based on this article ( http://thenoyes.com/littlenoise/?p=167 ) I was trying to make the same in Pg to see the effects (pg 9.1.1). I found this: postgres=# explain(buffers true, costs true, analyze true ) select i from random_values; QUER

Re: [GENERAL] SIGNALNAME in "pg_ctl kill"

2011-11-09 Thread Robert Treat
If you are trying to kill one specific connection/backend, I'd recommend using the pg_terminate_backend(pid_goes_here) function. Robert Treat conjecture: xzilla.net consulting: omniti.com On Wed, Nov 9, 2011 at 5:18 PM, Mike Blackwell wrote: > The manual section on the postmaster process has som

Re: [GENERAL] SIGNALNAME in "pg_ctl kill"

2011-11-09 Thread Andrew Sullivan
On Wed, Nov 09, 2011 at 03:02:00PM -0700, Gauthier, Dave wrote: > pg_ctl --help lists the various SIGNALNAME options to use with "pg_ctk > kill"... > > Allowed signal names for kill: > HUP INT QUIT ABRT TERM USR1 USR2 > > I can't find a description of what each does. I'd like to abort just th

Re: [GENERAL] Weird waste time when UNION ALL to an empty result set

2011-11-09 Thread Tom Lane
Emanuel Calvo writes: > postgres=# explain (buffers true, costs true, analyze true ) (select i > from random_values) UNION ALL (SELECT NULL LIMIT 0); > QUERY PLAN > ---

Re: [GENERAL] Weird waste time when UNION ALL to an empty result set

2011-11-09 Thread Emanuel Calvo
2011/11/10 Tom Lane : > Emanuel Calvo writes: >> postgres=# explain (buffers true, costs true, analyze true ) (select i >> from random_values) UNION ALL (SELECT NULL LIMIT 0); >>                                                               QUERY PLAN >> ---

[GENERAL] PostgreSQL 9.0.5 concat Issue

2011-11-09 Thread Keegan,Nate
I'm using a Perl script to take SNMP traps and send them to Zabbix on FreeBSD 8.2-RELEASE amd64. The original Perl script can be found at http://www.zabbix.com/wiki/howto/monitor/snmp/snmp_traps_-_a_new_solution This script works just fine under PostgreSQL 9.0.4. I'm using the FreeBSD ports sy

[GENERAL] count (DISTINCT field) OVER ()

2011-11-09 Thread Tarlika Elisabeth Schmitz
I would like to implement the equivalent of "count (DISTINCT field) OVER ()": SELECT id, name, similarity(name, 'Tooneyvara') as delta, count (id) OVER() AS cnt FROM vtown WHERE similarity(name, 'Tooneyvara') > 0.1 ORDER BY delta DESC produces result: 1787Toomyvara 0

Re: [GENERAL] count (DISTINCT field) OVER ()

2011-11-09 Thread David Johnston
On Nov 9, 2011, at 18:52, Tarlika Elisabeth Schmitz wrote: > I would like to implement the equivalent of "count (DISTINCT field) OVER > ()": > > > SELECT > id, name, similarity(name, 'Tooneyvara') as delta, > count (id) OVER() AS cnt > FROM vtown > WHERE > similarity(name, 'Tooneyva

Re: [GENERAL] PostgreSQL 9.0.5 concat Issue

2011-11-09 Thread David Johnston
On Nov 9, 2011, at 18:00, "Keegan,Nate" wrote: > I'm using a Perl script to take SNMP traps and send them to Zabbix on FreeBSD > 8.2-RELEASE amd64. > > The original Perl script can be found at > http://www.zabbix.com/wiki/howto/monitor/snmp/snmp_traps_-_a_new_solution > > This script works ju

[GENERAL] Returning a row from a function with an appended array field

2011-11-09 Thread Wes Cravens
I have an adjacency list kind of table CREATE TABLE thingy ( id int, parent int ); I'd like to be able to write a procedural function that returns a row or rows from this table with an appended field that represents the children. Something like this pseudo code: FOR row IN SELEC

Re: [GENERAL] Returning a row from a function with an appended array field

2011-11-09 Thread David Johnston
On Nov 9, 2011, at 20:19, Wes Cravens wrote: > I have an adjacency list kind of table > > CREATE TABLE thingy ( >id int, >parent int > ); > > I'd like to be able to write a procedural function that returns a row or > rows from this table with an appended field that represents the childr

Re: [GENERAL] Returning a row from a function with an appended array field

2011-11-09 Thread Wes Cravens
On 11/9/2011 7:34 PM, David Johnston wrote: > On Nov 9, 2011, at 20:19, Wes Cravens wrote: > >> I have an adjacency list kind of table >> >> CREATE TABLE thingy ( >>id int, >>parent int >> ); >> >> I'd like to be able to write a procedural function that returns a row or >> rows from this

Re: [GENERAL] PostgreSQL 9.0.5 concat Issue

2011-11-09 Thread Tom Lane
"Keegan,Nate" writes: > I'm guessing that the concat function changed between PostgreSQL 9.0.4 and > 9.0.5 in a subtle way that is breaking this script by causing the wrong > information to be returned from the database. There is no built-in function named concat() in Postgres 9.0.x, nor any pr

[GENERAL]

2011-11-09 Thread daflmx
Hello,all. I have installed the postgresql . $/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data LOG:database system was shut down at 2011-11-10 15:36:14 CST LOG:database system is ready to accept connections LOG:autovacuum launcher started but when I want to connect to the server at anot

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-11-09 Thread Kalai R
Hi, If binary files are missed, I copy them then service start. But sometimes I have the situation no one dll files are missed. But the service does not start. I don't know when will this happen and also I don't know why this happen. In this situation I have uninstall the postgres and reinstall