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

2010-08-03 Thread Alban Hertroys
On 2 Aug 2010, at 23:43, Radosław Smogura wrote: PostgreSQL already has BIGINT aka INT8, which are 8 bytes, and can represent integers up to like 9 billion billion (eg, 9 * 10^18). But I think about numbers with precision - you can use float for moneys, etc (rounding problems), and dividing

[GENERAL] pg_hba.conf

2010-08-03 Thread 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 template1, SSL off. How do I proceed with this error. What

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 template1, SSL

[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,

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 means

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 then it needs.

Re: [GENERAL] optimal memory

2010-08-03 Thread Scott Marlowe
2010/8/3 Sim Zacks s...@compulab.co.il: 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,

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

[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

Re: [GENERAL] Nodes and trees...

2010-08-03 Thread Merlin Moncure
On Tue, Aug 3, 2010 at 8:01 AM, Jason Schauberger crossroads0...@googlemail.com 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

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 does it

[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

[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

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:

[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

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

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

2010-08-03 Thread Tom Lane
Richard husttrip...@vip.sina.com 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

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,

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 ( id

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 from the

[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,

[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 a

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

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 georger.si...@gmail.com 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

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 transaction

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 give

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

Re: [GENERAL] Finding the primary key of tables

2010-08-03 Thread Merlin Moncure
2010/8/3 George Silva georger.si...@gmail.com: 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 =

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread Tom Lane
David Kerr d...@mr-paradox.net 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,

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 mmonc...@gmail.com 2010/8/3 George Silva georger.si...@gmail.com: 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

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 d...@mr-paradox.net 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? - -

Re: [GENERAL] Question about Idle in TX

2010-08-03 Thread Tom Lane
David Kerr d...@mr-paradox.net 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

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 d...@mr-paradox.net 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

Re: [GENERAL] optimal memory

2010-08-03 Thread Scott Marlowe
On Tue, Aug 3, 2010 at 6:27 AM, Sim Zacks s...@compulab.co.il 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

[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

[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:

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 tgarn...@panjiva.com 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

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 tgarn...@panjiva.com 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

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 I have

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

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

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

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 Hibernate

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:

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 cr...@postnewspapers.com.au 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

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 6 days

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 cr...@postnewspapers.com.au 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

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