[GENERAL] GetHierarchy

2013-02-28 Thread bhanu udaya
Greetings ! I have a hierarchy table with two attributes : Parent_ID, Child_ID with the sample data (can go upto n-level) as below: ParentID ChildID 1 3 1 4 3 5 5 6 6 7 I need a query to retrieve all the n level hierarchy when a Child node_i

Re: [GENERAL] Floating point error

2013-02-28 Thread Tom Duffey
Hi Everyone, To bring closure to this thread, my whole problem was caused by not knowing about the extra_float_digits setting. We have a script that uses COPY to transfer a subset of rows from a very large production table to a test table. The script was not setting extra_float_digits so the va

Re: [GENERAL] Floating point error

2013-02-28 Thread James Cloos
> "TD" == Tom Duffey writes: TD> Riddle me this. I have a database column of type "real" that gets TD> mapped to a Java field of type double via JDBC. ... TD> - Selecting values from both test and production DBs using psql TD> shows "10.3885" as the value TD> - The Java app on production

Re: [GENERAL] Poor performance when using a window function in a view

2013-02-28 Thread Chris Hanks
On Thu, Feb 28, 2013 at 6:00 AM, Tom Lane wrote: > Chris Hanks writes: > > create or replace view values_view as > > select fkey1, fkey3, > > (derived1 / max(derived1) over (partition by fkey1)) as derived1, > > (derived2 / sum(derived1) over (partition by fkey1)) as derived2 > > from ( > >

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Adrian Klaver
On 02/28/2013 12:58 PM, Anson Abraham wrote: oh yeah, i did ask this question. I had forgotten, and was hadnling other things. when you say cluster are you asking if there are multiple instances on the hardware. Aah, tells you how long since I used Debian, the command is actually pg_wrapper

Re: [GENERAL] Connection limit exceeded for non-superusers when there are plenty of available slots

2013-02-28 Thread Ned Wolpert
>From the docs: "superuser_reserved_connections: Whenever the number of active concurrent connections is at least max_connections minus superuser_reserved_connections, new connections will be accepted only for superusers, and no new replication connections will be accepted." ( http://www.postgresq

Re: [GENERAL] Connection limit exceeded for non-superusers when there are plenty of available slots

2013-02-28 Thread G B
My intention was to have 480 max connections for super user and 20 connections for non super user. (I created the non super user account for an external user to log into PgAdmin and look at the schema) Is there a problem with 20 connections in such a scenario? When I select from pg_stat_activity

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Anson Abraham
oh yeah, i did ask this question. I had forgotten, and was hadnling other things. when you say cluster are you asking if there are multiple instances on the hardware. There's only one instance running, and has been for some time. Our other physical server which is identical server and postgres

Re: [GENERAL] Connection limit exceeded for non-superusers when there are plenty of available slots

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 7:38 AM, G B wrote: > SHOW superuser_reserved_connections; > > 480 > > SHOW max_connections; > 500 > > Is there something I'm missing here? Thanks for your help. This leaves just 20 connections for non-root users. Did you intend to set superuser_reserved_connections

[GENERAL] Connection limit exceeded for non-superusers when there are plenty of available slots

2013-02-28 Thread G B
We have a number of applications using a production database under a super user account. I've created a new (non-super) user account and if I try to login using this account I get the "Non-superuser connection limit exceeded" error. I'm aware of the postgresql.conf settings for max user connections

[GENERAL] warm standby question

2013-02-28 Thread Sebastian Böhm
Hi, I have a primary server (9.1), which does wal archiving like this: wal_level = hot_standby archive_mode = on archive_command = 'test ! -f /home/autobackup/wal/%f && cp %p /home/autobackup/wal/%f' then I have a warm standby with this configuration in recovery.conf: restore_command = 'c

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Adrian Klaver
On 02/28/2013 11:58 AM, Anson Abraham wrote: db1 and db4 are 2 separate machines. no other instances of PG running on the box, doing a pg_ctl reload did nothing as well. Also looking @ all proecsses running, only PG instance on the box. I thought this sounded familiar, this is a reprise of th

Re: [GENERAL] how long to wait on 9.2 bitrock installer?

2013-02-28 Thread Thomas Kellerer
Adrian Klaver wrote on 28.02.2013 20:45: 9.2.3, Was running overnight for 17 hours. Cancelled install. May investigate further. Installing to Windows. Would seem to be a question for the folks at BitRock: http://bitrock.com/about.html I'm pretty sure that is the call of setacl.exe again - wh

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Anson Abraham
db1 and db4 are 2 separate machines. no other instances of PG running on the box, doing a pg_ctl reload did nothing as well. Also looking @ all proecsses running, only PG instance on the box. On Thu, Feb 28, 2013 at 2:27 PM, Adrian Klaver wrote: > On 02/28/2013 08:19 AM, Anson Abraham wrote: > >

Re: [GENERAL] how long to wait on 9.2 bitrock installer?

2013-02-28 Thread Adrian Klaver
On 02/28/2013 07:05 AM, Ronnie and Sandy wrote: 9.2.3, Was running overnight for 17 hours. Cancelled install. May investigate further. Installing to Windows. Would seem to be a question for the folks at BitRock: http://bitrock.com/about.html -- View this message in context: http://postgr

Re: [GENERAL] broke postgres, how to fix??

2013-02-28 Thread JD Wong
Hi Adrian, yes I completely copied the config-file and data directories over. Lonnie, I don't remember. I might not have shut down the "old" postgres, yes I set PGDATA accordingly. To sum things up, I created a situation where I would use the service to start "old" postgres and pg_ctl to start t

Re: [GENERAL] broke postgres, how to fix??

2013-02-28 Thread JD Wong
Hi Adrian, That's guaranteed to break everything badly. > Even if I "read only style" copied the files? Do you mind elaborating on why this happens? ( or point me to relevant documentation ) Thanks, -JD On Tue, Feb 26, 2013 at 7:04 PM, Lonni J Friedman wrote: > On Tue, Feb 26, 2013 at 4:02 PM

Re: [GENERAL] how long to wait on 9.2 bitrock installer?

2013-02-28 Thread Ronnie and Sandy
9.2.3, Was running overnight for 17 hours. Cancelled install. May investigate further. Installing to Windows. -- View this message in context: http://postgresql.1045698.n5.nabble.com/how-long-to-wait-on-9-2-bitrock-installer-tp5723762p5746908.html Sent from the PostgreSQL - general mailing list

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Adrian Klaver
On 02/28/2013 08:19 AM, Anson Abraham wrote: My postgresql-9.0-main.log file has suddenly stopped getting updated. I do not know why it stopped all of a sudden. We made a slight modification where changed in the postgresql.conf param: From log_connections = off log_disconnections = off To log

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Anson Abraham
how is that different from /etc/init.d/postgres reload or for that matter select pg_reload_conf() ? Which I execute both and they don't work either. On Thu, Feb 28, 2013 at 12:43 PM, Chris wrote: > > > On Feb 28, 2013, at 19:01, Anson Abraham wrote: > > *Note when I change > log_destination =

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Chris
On Feb 28, 2013, at 19:01, Anson Abraham wrote: > *Note when I change > log_destination = 'syslog' > > it does log to the syslog file. > > When I changed to to log_destination = 'stderr' still nothing logged. > > commenting out doesn't do much either. I initially thought it would be a > p

Re: [GENERAL] postgresql log file not getting update

2013-02-28 Thread Anson Abraham
*Note when I change log_destination = 'syslog' it does log to the syslog file. When I changed to to log_destination = 'stderr' still nothing logged. commenting out doesn't do much either. I initially thought it would be a perms thing, but when I deleted the file and did a reload, postgres creat

[GENERAL] postgresql log file not getting update

2013-02-28 Thread Anson Abraham
My postgresql-9.0-main.log file has suddenly stopped getting updated. I do not know why it stopped all of a sudden. We made a slight modification where changed in the postgresql.conf param: From log_connections = off log_disconnections = off To log_connections = on log_disconnections = on I'm

Re: [GENERAL] Poor performance when using a window function in a view

2013-02-28 Thread Tom Lane
Chris Hanks writes: > create or replace view values_view as > select fkey1, fkey3, > (derived1 / max(derived1) over (partition by fkey1)) as derived1, > (derived2 / sum(derived1) over (partition by fkey1)) as derived2 > from ( > select fkey1, fkey3, > cast(sum((case when (value > 0.0) th

Re: [GENERAL] Poor performance when using a window function in a view

2013-02-28 Thread Chris Hanks
On Wed, Feb 27, 2013 at 10:18 PM, Merlin Moncure wrote: > On Wed, Feb 27, 2013 at 8:22 PM, Chris Hanks > wrote: > > Hi. Sorry if this is repetitive, I tried posting to pgsql-performance > first > > but I think it got stuck in moderation. > > > > I'm trying to create a view that uses a window fun

Re: [GENERAL] Similarity Search with Wildcards

2013-02-28 Thread Ken Tanzer
I'm not sure about the indexing and performance impacts, but I think you could use SUBSTRING with a regex to pull out the client name, and then match on that. SELECT substring('Client Name - Description' FROM '^(.*) [-]'); substring - Client Name On Thu, Feb 28, 2013 at 12:02 AM

Re: [GENERAL] Similarity Search with Wildcards

2013-02-28 Thread Ghislain Hachey
On 02/28/2013 06:12 PM, John R Pierce wrote: > On 2/27/2013 10:35 PM, Ghislain Hachey wrote: >> I have a varchar column with content such as "Client Name - Brief >> Description of Problem" (it's a help desk ticket system). I want to >> generate reports by clients and the only thing I can base my qu