Re: [GENERAL] pg_hba.conf

2010-08-03 Thread A. Kretschmer
In response to quickinfo quickinfo : > Dear all, > > I am using postgres. when I try to connect to the database it is showing me > following error. Please look into that and help me out. > > an error occurred: > > FATAL: no pg_hba.conf entry for host "127.0.0.1", user "postgres", database > "tem

[GENERAL] optimal memory

2010-08-03 Thread Sim Zacks
Is there a way to tell what the optimal memory is for a specific postgresql instance? I am configuring Xen virtual machines and I don't want to give it more then it needs. Would looking at the swap be an indication? As soon as it starts to use swap, that means I need more, but until that point, I

Re: [GENERAL] optimal memory

2010-08-03 Thread A. Kretschmer
In response to Sim Zacks : > Is there a way to tell what the optimal memory is for a specific > postgresql instance? > > I am configuring Xen virtual machines and I don't want to give it more > then it needs. > > Would looking at the swap be an indication? As soon as it starts to use > swap, that

Re: [GENERAL] optimal memory

2010-08-03 Thread A. Kretschmer
In response to Sim Zacks : > > > On 03-Aug-2010 11:18 AM, A. Kretschmer wrote: > > In response to Sim Zacks : > > > >> Is there a way to tell what the optimal memory is for a specific > >> postgresql instance? > >> > >> I am configuring Xen virtual machines and I don't want to give it more > >

Re: [GENERAL] optimal memory

2010-08-03 Thread Scott Marlowe
2010/8/3 Sim Zacks : > Is there a way to tell what the optimal memory is for a specific > postgresql instance? > > I am configuring Xen virtual machines and I don't want to give it more > then it needs. > > Would looking at the swap be an indication? As soon as it starts to use > swap, that means I

Re: [GENERAL] optimal memory

2010-08-03 Thread Sim Zacks
> So, about how big is your db? How many users are likely to be running > queries at once? How big of a chunk of data are those users likely to > each need for sorts etc? > The database is 400MB (using du on the base folder), I have 10 active users who run queries and functions that generally

[GENERAL] deleting db cluster

2010-08-03 Thread Ulas Albayrak
Hi, I have a Linux/Debian machine running postgres 8.3 and I need to remove a database cluster that I created with the "initdb" command. Is it enough to just delete the folder in which the cluster resides on the filesystem, or does it require some additional actions? Regards -- Ulas Albayrak ula

[GENERAL] Nodes and trees...

2010-08-03 Thread Jason Schauberger
Dear fellow Postgres users, :-) please consider this table: CREATE TABLE nodes ( id int PRIMARY KEY, parent int REFERENCES nodes(id) ); In this table, each node *can* have a parent node. You can picture the whole set of rows of this table as one or more trees with nodes and t

Re: [GENERAL] Nodes and trees...

2010-08-03 Thread Merlin Moncure
On Tue, Aug 3, 2010 at 8:01 AM, Jason Schauberger wrote: > Dear fellow Postgres users, :-) > > please consider this table: > > CREATE TABLE nodes ( > > id      int     PRIMARY KEY, > > parent     int     REFERENCES nodes(id) > > ); > > In this table, each node *can* have a parent node. You can pic

Re: [GENERAL] Application user name attribute on connection pool

2010-08-03 Thread Peter C. Lai
Usually bighouse financial systems use BIGINT and a field to store position-of-decimal point to track arbitrary precision currency values... That's the "right way" to do it. I believe for mom-and-pop stuff, you can satisfy the auditors if you use NUMERIC(,2) and implement round-to-even (banker's

Re: [GENERAL] deleting db cluster

2010-08-03 Thread Joshua D. Drake
On Tue, 2010-08-03 at 16:15 +0200, Ulas Albayrak wrote: > Hi, > > I have a Linux/Debian machine running postgres 8.3 and I need to > remove a database cluster that I created with the "initdb" command. Is > it enough to just delete the folder in which the cluster resides on > the filesystem, or doe

[GENERAL] "package org.postgresql.util does not exist" compilation problem

2010-08-03 Thread Santiago Álvarez Martínez
Hi: I'm developing a Java application, using Maven, Spring and Hibernate, and Postgre (with Postgis) as DBMS. Everything went OK, until I had to import the org.postgresql.util package, to use the PGobject class, in a UserType Hibernate class. I got the following errors: [...] [loading org/p

[GENERAL] PG 8.4 won't start on Windows Server 2008 64-bit

2010-08-03 Thread David R Robison
I installed PostgreSQL 8.4 using the one-click installer. However, the postgres-8.4 windows service will not start. I have checked the Windows Event Log but there are no entries except one saying that the service start timed out. I checked the pg_log directory and all that is logged is 2010-0

Re: [GENERAL] PG 8.4 won't start on Windows Server 2008 64-bit

2010-08-03 Thread David R Robison
I ran postgres manually and got some additional information. The full log is 2010-08-03 15:34:01 GMT DEBUG: 0: postgres: PostmasterMain: initial environ dump: 2010-08-03 15:34:01 GMT LOCATION: PostmasterMain, .\src\backend\postmaster\postmaster.c:736 2010-08-03 15:34:01 GMT DEBUG:

[GENERAL] libpq logging redirection

2010-08-03 Thread devman
Hello Postgres Community, ist there any possibility for libpq clients to redirect the messages that are logged to stderr by libpq e.g. by registering a callback function to handle error logging by oneself? - Regards -- GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl. Bis zu 150

Re: [GENERAL] libpq logging redirection

2010-08-03 Thread Tom Lane
dev...@gmx-topmail.de writes: > ist there any possibility for libpq clients to redirect the messages that are > logged to stderr by libpq e.g. by registering a callback function to handle > error logging by oneself? http://www.postgresql.org/docs/8.4/static/libpq-notice-processing.html

Re: [GENERAL] PG 8.4 won't start on Windows Server 2008 64-bit

2010-08-03 Thread David R Robison
I uninstalled 8.4 and installed 8.3 with the same results. Any thoughts? David On 8/3/2010 11:37 AM, David R Robison wrote: I ran postgres manually and got some additional information. The full log is 2010-08-03 15:34:01 GMT DEBUG: 0: postgres: PostmasterMain: initial environ dump: 20

[GENERAL] Two problems when using Postgresql8.3.7, Please help me!

2010-08-03 Thread Richard
1.To add live HA to PG, I transfer WAL of a database instance(Primary node) to another database instance (standby node) at real time, and keep startup alive in standby node to recovery WAL online,so that standby node can be a hot standby. But I got some trouble. When standby node switch to prim

Re: [GENERAL] alter table set tablespace

2010-08-03 Thread ChronicDB Community Team
Jeff, One way to address the indefinite locking due to an ALTER TABLE statement for PostgreSQL is to use ChronicDB. It allows you to apply such a schema change live, without bringing down the database. The space requirements for applying the live schema change would be to have at least twice as m

Re: [GENERAL] Two problems when using Postgresql8.3.7, Please help me!

2010-08-03 Thread Tom Lane
"Richard" writes: > 1.To add live HA to PG, I transfer WAL of a database instance(Primary node) > to another database instance (standby node) at real time, and keep startup > alive in standby node to recovery WAL online,so that standby node can be a > hot standby. > But I got some trouble. Whe

Re: [GENERAL] Dynamic data model, locks and performance

2010-08-03 Thread ChronicDB Community Team
This example is certainly a workable situation. However it does require understanding the constraints of an ALTER TABLE statement and manually developing appropriate scripts. The update model offered my ChronicDB accounts for schema changes of considerable complexity, such as merging fields, parti

Re: [GENERAL] Nodes and trees...

2010-08-03 Thread Igor Neyman
> -Original Message- > From: Jason Schauberger [mailto:crossroads0...@googlemail.com] > Sent: Tuesday, August 03, 2010 8:02 AM > To: pgsql-general@postgresql.org > Subject: Nodes and trees... > > Dear fellow Postgres users, :-) > > please consider this table: > > CREATE TABLE nodes (

Re: [GENERAL] Nodes and trees...

2010-08-03 Thread David Fetter
On Tue, Aug 03, 2010 at 02:01:58PM +0200, Jason Schauberger wrote: > Dear fellow Postgres users, :-) > > please consider this table: > > CREATE TABLE nodes ( > > id int PRIMARY KEY, > > parent int REFERENCES nodes(id) > > ); Generally, you'll want to separate the nodes table

[GENERAL] Question about Idle in TX

2010-08-03 Thread David Kerr
I know that Idle in Transactions are a problem, however I'm trying to assess how much of a problem. for example: If a java program connects to the DB and does "begin;" and then internally does a "sleep 6 days" Does that cauz any issues other than eating a connection to the database? (note, not

[GENERAL] Finding the primary key of tables

2010-08-03 Thread George Silva
Hello guys, I'm building a function which needs to know what is the primary key of a certain table (all in pgplsql). I was using select * from information_schema.key_column_usage where table_schema='foo' and table_name = 'aaa'; but that will give me multiple results in case of additional keys in

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread John R Pierce
On 08/03/10 12:13 PM, David Kerr wrote: I know that Idle in Transactions are a problem, however I'm trying to assess how much of a problem. for example: If a java program connects to the DB and does "begin;" and then internally does a "sleep 6 days" Does that cauz any issues other than eating

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread John R Pierce
On 08/03/10 12:13 PM, George Silva wrote: Hello guys, I'm building a function which needs to know what is the primary key of a certain table (all in pgplsql). I was using select * from information_schema.key_column_usage where table_schema='foo' and table_name = 'aaa'; but that will give me

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread Greg Smith
David Kerr wrote: I know that "Idle in TXs" can interfere with Vaccums for example, but I'm not sure if that's due to them usually having some form of lock on a table. Locks aren't the issue. When you have a transaction open, the database makes sure it can deliver a consistent view of the

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread Merlin Moncure
On Tue, Aug 3, 2010 at 3:13 PM, George Silva wrote: > Hello guys, > > I'm building a function which needs to know what is the primary key of a > certain table (all in pgplsql). > > I was using select * from information_schema.key_column_usage where > table_schema='foo' and table_name = 'aaa'; but

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread David Kerr
On Tue, Aug 03, 2010 at 03:30:46PM -0400, Greg Smith wrote: - David Kerr wrote: - >I know that "Idle in TXs" can interfere with Vaccums for example, but - >I'm not sure if that's due to them usually having some form of lock on a - >table. - > - - Locks aren't the issue. When you have a transact

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread Devrim GÜNDÜZ
On Tue, 2010-08-03 at 16:13 -0300, George Silva wrote: > I'm building a function which needs to know what is the primary key of > a > certain table (all in pgplsql). > > I was using select * from information_schema.key_column_usage where > table_schema='foo' and table_name = 'aaa'; but that will g

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread George Silva
I'm going for Merlin's solution. Its the easiest one :P But I'm also having a problem: SELECT column_name FROM information_schema.key_column_usage k LEFT OUTER JOIN information_schema.table_constraints ON (k.table_name = table_constraints.table_name) WHERE table_constraints.constraint

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread Merlin Moncure
2010/8/3 George Silva : > I'm going for Merlin's solution. Its the easiest one :P > > But I'm also having a problem: > > SELECT column_name FROM information_schema.key_column_usage k >     LEFT OUTER JOIN information_schema.table_constraints ON (k.table_name = > table_constraints.table_name) > WHER

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread Tom Lane
David Kerr writes: > for example: If a java program connects to the DB and does "begin;" > and then internally does a "sleep 6 days" > Does that cauz any issues other than eating a connection to the database? In recent versions of PG, no. Before about 8.3 it was a Really Bad Idea, because the

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread George Silva
Thanks a million. Rusty SQL :P 2010/8/3 Merlin Moncure > 2010/8/3 George Silva : > > I'm going for Merlin's solution. Its the easiest one :P > > > > But I'm also having a problem: > > > > SELECT column_name FROM information_schema.key_column_usage k > > LEFT OUTER JOIN information_schema.tab

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread David Kerr
On Tue, Aug 03, 2010 at 03:49:57PM -0400, Tom Lane wrote: - David Kerr writes: - > for example: If a java program connects to the DB and does "begin;" - > and then internally does a "sleep 6 days" - - > Does that cauz any issues other than eating a connection to the database? - - In recent vers

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread Tom Lane
David Kerr writes: > On Tue, Aug 03, 2010 at 03:49:57PM -0400, Tom Lane wrote: > - In recent versions of PG, no. Before about 8.3 it was a Really Bad Idea, > - because the open transaction would prevent VACUUM from reclaiming storage. > We're on 8.3.9, so hopefully it's fairly safe then? Should

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread David Kerr
On Tue, Aug 03, 2010 at 03:57:27PM -0400, Tom Lane wrote: - David Kerr writes: - > On Tue, Aug 03, 2010 at 03:49:57PM -0400, Tom Lane wrote: - > - In recent versions of PG, no. Before about 8.3 it was a Really Bad Idea, - > - because the open transaction would prevent VACUUM from reclaiming stora

Re: [GENERAL] optimal memory

2010-08-03 Thread Scott Marlowe
On Tue, Aug 3, 2010 at 6:27 AM, Sim Zacks wrote: > >> So, about how big is your db?  How many users are likely to be running >> queries at once?  How big of a chunk of data are those users likely to >> each need for sorts etc? >> > The database is 400MB (using du on the base folder), I have 10 act

[GENERAL] When can postgresql use a partial (NOT NULL) index? Seems to depend on size of IN clause (even with enable seqscan = off)

2010-08-03 Thread Timothy Garnett
Hi all, I'm debugging a performance issue that looks like it might actually be an issue/limitation/parameter/bug in the query planner, but since I couldn't find anything authoritative on when exactly postgresql is able to use partial not null indexes I'm not sure that that's the case and I was hop

[GENERAL] problem with pg_standby

2010-08-03 Thread Gerd Koenig
Hello, we currently setup a standby database with archive_command sending the WALs from master to standby. This works as expected, but the standby database doesn't restore the WALs from the given directory in recovery.conf and I have no idea why... recovery.conf: restore_comman

Re: [GENERAL] When can postgresql use a partial (NOT NULL) index? Seems to depend on size of IN clause (even with enable seqscan = off)

2010-08-03 Thread Tom Lane
Timothy Garnett writes: > ... My first thought was that there was a problem with the > statistics/estimation in the planner, but using "set enable seq_scan=off;" > still does not use the index when there's over 100 bid's in the IN clause. > Breaking the IN clause into 2 < 100 element groups does h

Re: [GENERAL] When can postgresql use a partial (NOT NULL) index? Seems to depend on size of IN clause (even with enable seqscan = off)

2010-08-03 Thread Scott Marlowe
On Tue, Aug 3, 2010 at 2:03 PM, Timothy Garnett wrote: > Hi all, > > I'm debugging a performance issue that looks like it might actually be an > issue/limitation/parameter/bug in the query planner, but since I couldn't > find anything authoritative on when exactly postgresql is able to use > parti

Re: [GENERAL] problem with pg_standby

2010-08-03 Thread Joshua D. Drake
On Tue, 2010-08-03 at 22:37 +0200, Gerd Koenig wrote: > Hello, > > we currently setup a standby database with archive_command sending the WALs > from master to standby. > This works as expected, but the standby database doesn't restore the WALs > from > the given directory in recovery.conf and

Re: [GENERAL] problem with pg_standby

2010-08-03 Thread Gerd Koenig
Hi again, I just want to drop you an additional note. After several attempts of debugging pg_standby is restoring the WAL files as expected, but I cannot explain why... First startup of postgres was with init-script provided by the rpm installation (/etc/init.d/postgresql start as user root).

Re: [GENERAL] problem with pg_standby

2010-08-03 Thread Greg Smith
Gerd Koenig wrote: Since even the init-script starts pg as user postgres I have no idea what differs from init-script to direct call of pg_ctl as user postgres...?!?! Do you have SELinux turned on? That can do weird stuff like this--the init script will be running with restrictions the man

Re: [GENERAL] When can postgresql use a partial (NOT NULL) index? Seems to depend on size of IN clause (even with enable seqscan = off)

2010-08-03 Thread Timothy Garnett
Adding the is not null clause does allow the query to use the index again (and is a much cleaner workaround in that I don't have to change the indexes or rely on any magic number for splitting the in clauses). Also makes sense since it more exactly matches the partial indexing condition. Thanks T

Re: [GENERAL] Danger of idiomatic plpgsql loop for merging data

2010-08-03 Thread J. Greg Davidson
Hi fellow PostgreSQL hackers, First, a thank you to Merlin for commenting on my earlier post! I've run into another dangerous problem since the earlier post. I began converting from the plpgsql loop idiom for merging data into a COALESCE(find(), create(), find()) idiom and ran into a problem with

Re: [GENERAL] "package org.postgresql.util does not exist" compilation problem

2010-08-03 Thread Craig Ringer
On 03/08/10 23:18, Santiago Álvarez Martínez wrote: > > Hi: > > I'm developing a Java application, using Maven, Spring and Hibernate, > and Postgre (with Postgis) as DBMS. > > Everything went OK, until I had to import the org.postgresql.util > package, to use the PGobject class, in a UserType Hi

Re: [GENERAL] PG 8.4 won't start on Windows Server 2008 64-bit

2010-08-03 Thread Craig Ringer
On 03/08/10 23:37, David R Robison wrote: > > 2010-08-03 15:34:01 GMT LOCATION: PostmasterMain, > .\src\backend\postmaster\postmaster.c:743 > 2010-08-03 15:34:01 GMT DEBUG: 0: TZ "US/Eastern" matches Windows > timezone "Eastern Daylight Time" > 2010-08-03 15:34:01 GMT LOCATION: identify_sys

Re: [GENERAL] problem with pg_standby

2010-08-03 Thread Gerd Koenig
Hello Greg, thanks for the hint, yes, SELinux caused the troubles. It complained about wrong filecontext while starting postgres via init-script. Filecontext was: var_lib_t and it should be: postgresql_t regards...GERD On Tuesday, August 03, 2010 11:54:45 pm Greg Smith wrote: > Gerd Koenig

Re: [GENERAL] PG 8.4 won't start on Windows Server 2008 64-bit

2010-08-03 Thread Tom Lane
Craig Ringer writes: > On 03/08/10 23:37, David R Robison wrote: >> 2010-08-03 15:34:01 GMT LOCATION: PostmasterMain, >> .\src\backend\postmaster\postmaster.c:743 >> 2010-08-03 15:34:01 GMT DEBUG: 0: TZ "US/Eastern" matches Windows >> timezone "Eastern Daylight Time" >> 2010-08-03 15:34:01 G

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread Craig Ringer
On 04/08/10 03:17, John R Pierce wrote: > On 08/03/10 12:13 PM, David Kerr wrote: >> I know that Idle in Transactions are a problem, however I'm trying to >> assess how much of a problem. >> >> for example: If a java program connects to the DB and does "begin;" >> and then internally does a "sleep

Re: [GENERAL] PG 8.4 won't start on Windows Server 2008 64-bit

2010-08-03 Thread Craig Ringer
On 04/08/10 13:22, Tom Lane wrote: > Craig Ringer writes: >> On 03/08/10 23:37, David R Robison wrote: >>> 2010-08-03 15:34:01 GMT LOCATION: PostmasterMain, >>> .\src\backend\postmaster\postmaster.c:743 >>> 2010-08-03 15:34:01 GMT DEBUG: 0: TZ "US/Eastern" matches Windows >>> timezone "Easte

Re: [GENERAL] problem with pg_standby

2010-08-03 Thread Greg Smith
Gerd Koenig wrote: thanks for the hint, yes, SELinux caused the troubles. It complained about wrong filecontext while starting postgres via init-script. Filecontext was: var_lib_t and it should be: postgresql_t If you want to keep SELinux on, basically you have to relabel the directory you

Re: [GENERAL] problem with pg_standby

2010-08-03 Thread Gerd Koenig
thanks Greg, yes, we want SELinux in enforcing mode. Thereby (and to ensure persistence) just chcon is the wrong way and * semanage fcontext -a -t postgresql_t '' * restorecon -vvFR is much better ;-) regards--GERD-- On Wednesday, August 04, 2010 07:56:56 am Greg Smith wrote: > Gerd Koenig wrote