[GENERAL] Request for comment: pgjson project

2010-10-15 Thread Terry Laurenzo
Hi all - http://github.com/tlaurenzo/pgjson I'm a long-time postgres user but have never developed any extensions for it. I had some time over the past week and decided to tackle a project I've had on my list for a while: adding robust JSON capabilities to the database server. This is the first

Re: [GENERAL] It it possible to get this result in one query?

2010-10-15 Thread Guy Rouillier
Sure, did you look in the documentation? select t3.id, coalesce ( t1.title, t2.title, t3.title ), string_to_array(coalesce ( case when t1.title is not null then 'table_one,' else null end, case when

Re: [GENERAL] [PERFORM] help with understanding EXPLAIN

2010-10-15 Thread Craig Ringer
On 10/14/2010 05:18 AM, Brandon Casci wrote: Hello I have an application hosted on Heroku. They use postgres. It's more or less abstracted away, but I can get some performance data from New Relic. For the most part, performance is ok, but now and then some queries take a few seconds, and spike u

Re: [GENERAL] Strange phenomenon

2010-10-15 Thread Craig Ringer
On 10/15/2010 03:36 PM, Martial Braem wrote: 2) On day one, I store data in my application data tables and in the logging table (transactional data). At the end of the day, I extract the data from the database for daily reporting (the ultimate proof that the transactions are actually committed).

Re: [GENERAL] Strange phenomenon

2010-10-15 Thread Joshua J. Kugler
On Friday 15 October 2010, Scott Marlowe elucidated thus: > On Fri, Oct 15, 2010 at 12:37 PM, Tom Lane wrote: > > I'd look around for a cron job or some other periodic task that > > thinks it's supposed to reload the database or something like that. > >  Postgres doesn't forget stuff that easily .

Re: [GENERAL] Strange phenomenon

2010-10-15 Thread Scott Marlowe
On Fri, Oct 15, 2010 at 12:37 PM, Tom Lane wrote: > > I'd look around for a cron job or some other periodic task that thinks > it's supposed to reload the database or something like that.  Postgres > doesn't forget stuff that easily ... unless it's told to. Had a search engine eat an entire datab

Re: [GENERAL] Strange phenomenon

2010-10-15 Thread Tom Lane
"Martial Braem" writes: > Recently I observed a strange phenomenon: > 1) The database has some tables where I store my application data. > I have an additional table, with no relation to any other table, just > for logging purposes. In the database, a sequence is defined too. > 2) On day

Re: [GENERAL] how to write an optimized sql with two same subsql?

2010-10-15 Thread Igor Neyman
> -Original Message- > From: sunpeng [mailto:blueva...@gmail.com] > Sent: Thursday, October 14, 2010 7:34 PM > To: pgsql-general@postgresql.org > Subject: how to write an optimized sql with two same subsql? > > We have a table A: > CREATE TABLE A( >uid integer, >groupid integer

Re: [GENERAL] It it possible to get this result in one query?

2010-10-15 Thread Merlin Moncure
On Fri, Oct 15, 2010 at 2:55 AM, Nick wrote: > Thanks Guy, is it possible to get the 3rd column result as an array > instead of string? -Nick tbh, your solution using array_agg over union all upthread looked spot on... merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Strange phenomenon

2010-10-15 Thread Szymon Guz
On 15 October 2010 09:36, Martial Braem wrote: > Hi, > > > > I am a Java developer, using PostgreSQL as a database. > > Recently I observed a strange phenomenon: > > 1) The database has some tables where I store my application data. I > have an additional table, with no relation to any othe

Re: [GENERAL] It it possible to get this result in one query?

2010-10-15 Thread Nick
Thanks Guy, is it possible to get the 3rd column result as an array instead of string? -Nick On Oct 14, 9:27 pm, guyr-...@burntmail.com (Guy Rouillier) wrote: > Sure: > > select >     t3.id, >     coalesce >        ( >        t1.title, >        t2.title, >        t3.title >        ), >     coalesc

[GENERAL] Strange phenomenon

2010-10-15 Thread Martial Braem
Hi, I am a Java developer, using PostgreSQL as a database. Recently I observed a strange phenomenon: 1) The database has some tables where I store my application data. I have an additional table, with no relation to any other table, just for logging purposes. In the database, a sequence is d

Re: [GENERAL] Segfault : PostgreSQL 9.0.0 and PgPool-II.

2010-10-15 Thread Adrian Klaver
On Friday 15 October 2010 7:26:34 am Ugo PARSI wrote: > Hello, > > Thank you for your answer. > > For my simple test, I was only using pgPool-II in front of a single > PgSQL server with nothing configured. > I've just followed the basic installation guide of pgPool-II. In your original message you

Re: [GENERAL] Segfault : PostgreSQL 9.0.0 and PgPool-II.

2010-10-15 Thread Ugo PARSI
Still no luck :/ I made it work though by putting everything in "trust" in pg_hba.conf but it's not really secure :) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Segfault : PostgreSQL 9.0.0 and PgPool-II.

2010-10-15 Thread Ugo PARSI
Hello, Thank you for your answer. For my simple test, I was only using pgPool-II in front of a single PgSQL server with nothing configured. I've just followed the basic installation guide of pgPool-II. From what I understand from the documentation you're referring me too, it should work in my ca

Re: [GENERAL] Point inside/outside area constructed by an expanded path

2010-10-15 Thread Merlin Moncure
On Thu, Oct 14, 2010 at 3:00 PM, Josi Perez (3T Systems) wrote: > Hi, > > I use postgreSQL.8.4.2 and don't have postGIS installed. > I have a geometric type polygon and I know that it is possible to determine > if a point it is inside or not of this polygon, using anything like that: > select > po

Re: [GENERAL] How to determine failed connection attempt due to invalid authorization (libpq)?

2010-10-15 Thread Bob Pawley
Hi Dimitriy Did you ever get an answer to your query regarding connection security. I`m not only interested in this aspect, I am also interested in how to detect any unauthorized connection attempt whether through the front door or the back door. Bob From: Dmitriy Igrishin Sent: Wednesday,

Re: [GENERAL] column-level update privs + lock table

2010-10-15 Thread Simon Riggs
On Mon, 2010-10-11 at 09:41 -0400, Josh Kupershmidt wrote: > On Thu, Oct 7, 2010 at 7:43 PM, Josh Kupershmidt wrote: > > > I noticed that granting a user column-level update privileges doesn't > > allow that user to issue LOCK TABLE with any mode other than Access > > Share. > > Anyone think thi

Re: [GENERAL] input out of error with haversine formula

2010-10-15 Thread Dean Rasheed
On 15 October 2010 06:03, Vince Carney wrote: > The following will return an input out of error as the acos() function > cannot be -1 <= x <= 1. > SELECT * FROM >                 (SELECT *, (3959 * acos(cos(radians(37.7438640)) * > cos(radians(37.7438640)) * cos(radians(-97.4631299) - >