Re: [GENERAL] Collapsing multiple subqueries into one

2011-08-23 Thread Chris Hanks
Thanks Royce. I put together another query using a WITH statement that's also working: WITH v AS ( SELECT item_id, type, direction, array_agg(user_id) as user_ids FROM votes WHERE root_id = 5305 GROUP BY type, direction, item_id ORDER BY type, direction, item_id ) SELECT *, (SELECT use

Re: [GENERAL] JDBC Connection Errors

2011-08-23 Thread Guillaume Lelarge
On Tue, 2011-08-23 at 19:38 -0400, Dave Cramer wrote: > The only difference JDBC has over psql is that it has to connect via > tcpip. Not sure about pgadmin. > pgAdmin is like psql on this. It can use TCP connections, and socket connections. -- Guillaume http://blog.guillaume.lelarge.info

Re: [GENERAL] postgresql server crash on windows 7 when using plpython

2011-08-23 Thread c k
Yes, Now I have removed python 2.7. Restarted the postgresql. When I call the above mentioned function, now server doesn't crash. It is running, but I get the error 'No connection to the server'. I am using PgAdmin to work with Postgresql. I tried to execute a simple function to show python version

Re: [GENERAL] documentation suggestion

2011-08-23 Thread Rob Sargent
Bruce Momjian wrote: Rob Sargent wrote: Apologies if this is the wrong forum. If there has been a suggestion to get the "Up" hyperlink placed also at/near the top of the page, please add my vote. Else could this be considered as a feature request? I have talked to Peter Eisentraut o

Re: [GENERAL] Postgres on SSD

2011-08-23 Thread Ondrej Ivanič
Hi, On 12 August 2011 14:57, Greg Smith wrote: >> I'm about to evaluate this SSD card: FusionIO ioDrive Duo [1]. The >> main reason for this experiment is to see if SSD can significantly >> improve query performance The result is that FusionIO will help to our queries which was expected. Most of

Re: [GENERAL] documentation suggestion

2011-08-23 Thread Bruce Momjian
Rob Sargent wrote: > Apologies if this is the wrong forum. > > If there has been a suggestion to get the "Up" hyperlink placed also > at/near the top of the page, please add my vote. Else could this be > considered as a feature request? I have talked to Peter Eisentraut on several occasions durin

Re: [GENERAL] Collapsing multiple subqueries into one

2011-08-23 Thread Royce Ausburn
This might help you: http://www.postgresql.org/docs/8.4/static/queries-with.html On 24/08/2011, at 9:54 AM, Chris Hanks wrote: > I have two tables: > > CREATE TABLE items > ( > root_id integer NOT NULL, > id serial NOT NULL, > -- Other fields... > > CONSTRAINT items_pkey PRIMARY KEY (root_

Re: [GENERAL] JDBC Connection Errors

2011-08-23 Thread Sam Nelson
Everything is remote. I thought of the IPv6 thing, but that seems unlikely - all connections are coming from the same system. Still, we'll ask them and try to get some more details about things like that. --- === Samuel Nelson Consistent State www.consistentstate.com 303-9

Re: [GENERAL] JDBC Connection Errors

2011-08-23 Thread Adrian Klaver
On Tuesday, August 23, 2011 6:58:13 pm Sam Nelson wrote: > Everything is remote. I thought of the IPv6 thing, but that seems > unlikely - all connections are coming from the same system. The easy way to test is to throw in an IPv6 rule that matches the IPv4 rule into pg_hba.conf. > > Still, w

Re: [GENERAL] Wal archiving and streaming replication

2011-08-23 Thread Raghavendra
On Tue, Aug 23, 2011 at 10:49 PM, Ray Stell wrote: > On Tue, Aug 23, 2011 at 08:30:55PM +0530, Raghavendra wrote: > > > > Is it a best practice to keep cluster in Archive_mode = on and setup > > streaming replication or just leave archive_mode=off? > > Depends. The reason for creating WAL is in

[GENERAL] Collapsing multiple subqueries into one

2011-08-23 Thread Chris Hanks
I have two tables: CREATE TABLE items ( root_id integer NOT NULL, id serial NOT NULL, -- Other fields... CONSTRAINT items_pkey PRIMARY KEY (root_id, id) ) CREATE TABLE votes ( root_id integer NOT NULL, item_id integer NOT NULL, user_id integer NOT NULL, type smallint NOT NULL,

Re: [GENERAL] JDBC Connection Errors

2011-08-23 Thread Adrian Klaver
On Tuesday, August 23, 2011 3:47:33 pm Sam Nelson wrote: > Hi list, > > A client is hitting an issue with JDBC: > org.postgresql.util.PSQLException: Connection refused. Check that the > hostname and port are correct and that the postmaster is accepting > TCP/IP connections. > > -pg_hba.conf is se

Re: [GENERAL] JDBC Connection Errors

2011-08-23 Thread Dave Cramer
The only difference JDBC has over psql is that it has to connect via tcpip. Not sure about pgadmin. Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Tue, Aug 23, 2011 at 6:47 PM, Sam Nelson wrote: > Hi list, > > A client is hitting an issue with JDBC: > org.postgresql.uti

Re: [GENERAL] View "Caching" - Is this Known and Expected Behavior?

2011-08-23 Thread David Johnston
-Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Tuesday, August 23, 2011 5:51 PM To: David Johnston Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] View "Caching" - Is this Known and Expected Behavior? "David Johnston" writes: > I am wondering whether the beh

[GENERAL] documentation suggestion

2011-08-23 Thread Rob Sargent
Apologies if this is the wrong forum. If there has been a suggestion to get the "Up" hyperlink placed also at/near the top of the page, please add my vote. Else could this be considered as a feature request? rjs -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

[GENERAL] JDBC Connection Errors

2011-08-23 Thread Sam Nelson
Hi list, A client is hitting an issue with JDBC: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. -pg_hba.conf is set to trust 0.0.0.0/0 (IPv4 only) -listen_addresses is * -I can find no ev

Re: [GENERAL] View "Caching" - Is this Known and Expected Behavior?

2011-08-23 Thread Merlin Moncure
On Tue, Aug 23, 2011 at 4:36 PM, David Johnston wrote: > Hey All, > > I am wondering whether the behavior I am observing is expected.  The rough > scenario I have setup goes as follows (I can likely put together a test > script if that is warranted): > > version > > PostgreSQL 9.0.3 on x86_64-pc-l

Re: [GENERAL] View "Caching" - Is this Known and Expected Behavior?

2011-08-23 Thread Tom Lane
"David Johnston" writes: > I am wondering whether the behavior I am observing is expected. No, it isn't. Please provide a concrete test case. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: h

[GENERAL] View "Caching" - Is this Known and Expected Behavior?

2011-08-23 Thread David Johnston
Hey All, I am wondering whether the behavior I am observing is expected. The rough scenario I have setup goes as follows (I can likely put together a test script if that is warranted): version PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.

Re: [GENERAL] Wal archiving and streaming replication

2011-08-23 Thread Ray Stell
On Tue, Aug 23, 2011 at 08:30:55PM +0530, Raghavendra wrote: > > Is it a best practice to keep cluster in Archive_mode = on and setup > streaming replication or just leave archive_mode=off? Depends. The reason for creating WAL is in case they are needed for recovery. In the event that the stby h

Re: [GENERAL] Executing more than one function.

2011-08-23 Thread Giuseppe Sacco
Il giorno mar, 23/08/2011 alle 16.30 +0100, f vf ha scritto: [...] > it takes more time than if I execute one function at the time and sum > the execution times of each one: > > > BEGIN; > SELECT functionX(); > COMMIT; > You should probably accout a time for the COMMIT operation. In one case yo

[GENERAL] Executing more than one function.

2011-08-23 Thread f vf
Hello, I have a set of plsql functions that I want to execute. All these functions perform queries and insert data in the database and I need to execute them in order. What I have noticed is that if I execute this script BEGIN; SELECT function1(); COMMIT; BEGIN; SELECT function2(); COMMIT; BEGIN

Re: [GENERAL] Wal archiving and streaming replication

2011-08-23 Thread Raghavendra
On Tue, Aug 23, 2011 at 7:17 PM, Ray Stell wrote: > On Tue, Aug 23, 2011 at 06:23:58AM -0700, Adrian Klaver wrote: > > On Tuesday, August 23, 2011 4:14:15 am Ray Stell wrote: > > > On Tue, Aug 23, 2011 at 02:01:10AM -0700, alexondi wrote: > > > > Hi! > > > > Do I need setup wal archiving (archivi

Re: [GENERAL] COPY FROM (query) in plpgsql

2011-08-23 Thread Vincent Veyron
Le mardi 23 août 2011 à 11:29 +0200, Marc Mamin a écrit : > Hello, > > there seems to be no way to use COPY this way, so I guess this is a > feature request... > > this may also help users who tried using COPY FROM STDIN in plpgsql. > > > I have a query with a lot of string manipulation that re

Re: [GENERAL] GRANT privileges strange behavior

2011-08-23 Thread Guillaume Lelarge
On Tue, 2011-08-23 at 06:43 -0700, igivanoff wrote: > Hi, > > I have the following situation: > > postgres=# create database foo with encoding = 'UTF8'; > postgres=# \c foo > foo=# CREATE SCHEMA sc; > foo=# ALTER DATABASE foo SET search_path=sc, pg_catalog; > foo=# CREATE ROLE usr LOGIN PASSWORD

[GENERAL] GRANT privileges strange behavior

2011-08-23 Thread igivanoff
Hi, I have the following situation: postgres=# create database foo with encoding = 'UTF8'; postgres=# \c foo foo=# CREATE SCHEMA sc; foo=# ALTER DATABASE foo SET search_path=sc, pg_catalog; foo=# CREATE ROLE usr LOGIN PASSWORD 'usr' NOINHERIT CREATEDB VALID UNTIL 'infinity'; foo=# grant all privi

Re: [GENERAL] Wal archiving and streaming replication

2011-08-23 Thread Ray Stell
On Tue, Aug 23, 2011 at 06:23:58AM -0700, Adrian Klaver wrote: > On Tuesday, August 23, 2011 4:14:15 am Ray Stell wrote: > > On Tue, Aug 23, 2011 at 02:01:10AM -0700, alexondi wrote: > > > Hi! > > > Do I need setup wal archiving (archiving_mode = on) setup when I use > > > streaming replication? >

Re: [GENERAL] Wal archiving and streaming replication

2011-08-23 Thread Adrian Klaver
On Tuesday, August 23, 2011 4:14:15 am Ray Stell wrote: > On Tue, Aug 23, 2011 at 02:01:10AM -0700, alexondi wrote: > > Hi! > > Do I need setup wal archiving (archiving_mode = on) setup when I use > > streaming replication? > > yes > http://www.postgresql.org/docs/current/interactive/high-availab

Re: [GENERAL] Wal archiving and streaming replication

2011-08-23 Thread Ray Stell
On Tue, Aug 23, 2011 at 02:01:10AM -0700, alexondi wrote: > Hi! > Do I need setup wal archiving (archiving_mode = on) setup when I use > streaming replication? yes http://www.postgresql.org/docs/current/interactive/high-availability.html -- Sent via pgsql-general mailing list (pgsql-general@pos

[GENERAL] COPY FROM (query) in plpgsql

2011-08-23 Thread Marc Mamin
Hello, there seems to be no way to use COPY this way, so I guess this is a feature request... this may also help users who tried using COPY FROM STDIN in plpgsql. I have a query with a lot of string manipulation that returns data as single strings, e.g.: 'a,12,ght,45,1.2' 'b,13,ght,45,1.1' 'a

[GENERAL] Wal archiving and streaming replication

2011-08-23 Thread alexondi
Hi! Do I need setup wal archiving (archiving_mode = on) setup when I use streaming replication? -- View this message in context: http://postgresql.1045698.n5.nabble.com/Wal-archiving-and-streaming-replication-tp4726040p4726040.html Sent from the PostgreSQL - general mailing list archive at Nabbl

Re: [GENERAL] Getting value of bind variables

2011-08-23 Thread Martijn van Oosterhout
On Tue, Aug 23, 2011 at 09:07:20AM +0530, Jayadevan M wrote: > I guess so. But when I tried the same query on psql by replacing ($4) with > a value like '20110404', the query works OK. The value of $4 is being > passed from a java application. So does this mean I have to change the > data type i

Re: [GENERAL] SSL certificates issue

2011-08-23 Thread Giuseppe Sacco
Il giorno lun, 22/08/2011 alle 09.37 -0400, Tom Lane ha scritto: > Asia writes: > > Now the issue is then when using libpq it was enough to have only root > > certificate in server's root.crt and it worked fine. > > But when I tried using the same with JDBC it turned out that I need to put > > w