[ADMIN] startup Postgres on NT

2001-01-31 Thread wit

Hello,

I download cygwin package, IPC package and postgres's binaries and install
them on NT.
I startup postgres with the following command:
   - open cygwin-shell
   - ipc-daemon&
   - postmaster -i -S
1. When I close cygwin-shell or I logout, postgres process will close too.
How to keep progres process running when I logout?
2. How to startup postgres with NT startup?

Regards,
wit







[ADMIN] Spurious failure to obtain row lock possible in PG 9.1?

2012-09-24 Thread henk de wit

I'm using Postgres 9.1 on Debian Lenny and via a Java server (JBoss AS 6.1) I'm 
executing a simple "select ... for update" query:
SELECT
importing
FROM
customer
WHERE
id = :customer_id
FOR UPDATE NOWAIT
Once every 10 to 20 times Postgres fails to obtain the lock for no apparent 
reason:
18:22:18,285 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, 
SQLState: 55P0318:22:18,285 ERROR [org.hibernate.util.JDBCExceptionReporter] 
ERROR: could not obtain lock on row in relation "customer"
I'm "pretty" sure there's really no other process that has the lock, as I'm the 
only one on a test DB. If I execute the query immediately again, it does 
succeed in obtaining the lock. I can however not reproduce this via e.g. 
PGAdmin.

Is it possible or perhaps even known that PG has this behavior, or should I 
look for the cause in the Java code? (I'm using Java EE"s entity manager to 
execute a native query inside an EJB bean that lets a JDBC connection from a 
pool join a JTA transaction.)
Thanks!   

[ADMIN] Query with limit takes hours

2012-10-13 Thread henk de wit

On PG 9.1 and 9.2 I'm running the following query:
SELECT *FROM stream_store JOIN(SELECT 
UNNEST(stream_store_ids) AS idFROM 
stream_store_version_index WHERE stream_id = 607106 AND 
   version = 11) AS records USING (id)ORDER BY id DESC
This takes several (10 to 20) milliseconds at most.
When I add a LIMIT 1 to the end of the query, the query time goes to several 
hours(!).
The full version String of PG 9.1 is "PostgreSQL 9.1.5 on 
x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 
64-bit". The 9.1 machine is a socket 771 dual quad core at 3.16Ghz with 64GB 
memory and 10 Intel x25M SSDs in a RAID5 setup on 2 ARECA 1680 RAID 
controllers. The "stream_store" table has 122 million rows and is partitioned. 
The array that's being unnested for the join has 27 entries.
Any idea?