Re: [GENERAL] plpython intermittent ImportErrors

2013-01-17 Thread Stuart Bishop
On Mon, Jan 14, 2013 at 11:30 PM, Brian Sutherland wrote: > Hi, > > I have a plpython stored procedure which sometimes fails when I run my > applications automated test suite. The procedure is called hundreds of > times during the tests but only fails a few times, often with the > following Import

Re: [GENERAL] Best method to compare subdomains

2013-01-17 Thread Sumit Raja
On 16 January 2013 20:23, Robert James wrote: > Is there a recommended, high performance method to check for subdomains? > > Something like: > - www.google.com is subdomain of google.com > - ilikegoogle.com is not subdomain of google.com > > There are many ways to do this (lowercase and reverse t

Re: [GENERAL] Best method to compare subdomains

2013-01-17 Thread John R Pierce
On 1/17/2013 1:12 AM, Sumit Raja wrote: On 16 January 2013 20:23, Robert James > wrote: Is there a recommended, high performance method to check for subdomains? Something like: - www.google.com is subdomain of google.com

[GENERAL] String comparison and the SQL standard

2013-01-17 Thread Albe Laurenz
While researching a problem with a different database system, I came across the following in the SQL standard ISO/IEC 9075-2:2003, Section 8.2 (), General Rules: 3) The comparison of two character strings is determined as follows: a) Let CS be the collation as determined by Subclause 9.13,

Re: [GENERAL] String comparison and the SQL standard

2013-01-17 Thread Albe Laurenz
I wrote: > While researching a problem with a different database system, > I came across the following in the SQL standard ISO/IEC 9075-2:2003, > Section 8.2 (), General Rules: > > 3) [...] > > That would effectively mean that 'a'='a ' is TRUE for > all character string types. Searching furthe

Re: [GENERAL] plpython intermittent ImportErrors

2013-01-17 Thread Brian Sutherland
On Thu, Jan 17, 2013 at 03:18:09PM +0700, Stuart Bishop wrote: > On Mon, Jan 14, 2013 at 11:30 PM, Brian Sutherland > wrote: > > Hi, > > > > I have a plpython stored procedure which sometimes fails when I run my > > applications automated test suite. The procedure is called hundreds of > > times d

Fwd: [GENERAL] Sample databases

2013-01-17 Thread Vraj Mohan
-- Forwarded message -- From: Vraj Mohan Date: Thu, Jan 17, 2013 at 7:22 AM Subject: Re: [GENERAL] Sample databases To: Jeff Janes On Wed, Jan 16, 2013 at 10:32 PM, Jeff Janes wrote: > What do you mean by decent data volumes? Numbers and units are wonderful > things! Sorry, I

Re: [GENERAL] plpython intermittent ImportErrors

2013-01-17 Thread Alban Hertroys
On 17 January 2013 12:30, Brian Sutherland wrote: > > (we use buildout for our Python code, but our plpythonu stored > > procedures use the stock standard Python environment, as provided by > > the Ubuntu packages). > > Sadly, I need to get this running on OSX as that's what our developers > use.

Re: [GENERAL] plpython intermittent ImportErrors

2013-01-17 Thread Brian Sutherland
On Thu, Jan 17, 2013 at 01:25:54PM +0100, Alban Hertroys wrote: > On 17 January 2013 12:30, Brian Sutherland wrote: > > > > (we use buildout for our Python code, but our plpythonu stored > > > procedures use the stock standard Python environment, as provided by > > > the Ubuntu packages). > > > >

[GENERAL] standby, pg_basebackup and last xlog file

2013-01-17 Thread Миша Тюрин
Hello! Is there any reason why pg_basebackup has limitation in an online backup from the standby: "The backup history file is not created in the database cluster backed up." ? So i can't get last xlog file needed to restore :( Think i can use -x option for getting last xlog file, but i would l

Re: [GENERAL] speeding up a join query that utilizes a view

2013-01-17 Thread Igor Neyman
> -Original Message- > From: Kirk Wythers [mailto:kwyth...@umn.edu] > Sent: Thursday, January 17, 2013 12:16 AM > To: pgsql-general@postgresql.org > Subject: speeding up a join query that utilizes a view > > I am looking for advice on a performance problem. I'm pretty sure that > the culpr

Re: [GENERAL] String comparison and the SQL standard

2013-01-17 Thread Tom Lane
Albe Laurenz writes: > While researching a problem with a different database system, > I came across the following in the SQL standard ISO/IEC 9075-2:2003, > Section 8.2 (), General Rules: > 3) The comparison of two character strings is determined as follows: >a) Let CS be the collation as de

Re: [GENERAL] Libpq and multithreading

2013-01-17 Thread Merlin Moncure
On Mon, Jan 14, 2013 at 9:57 AM, Asia wrote: > It is not possible because connection is local variable in both thread > functions, no common variables are used. > > I checked that it also crashes without SSL. Two threads connecting to the > same server, different databases. hm, where is your li

[GENERAL] Determine if an index is a B-tree, GIST, or something else?

2013-01-17 Thread Paul Jungwirth
Is there any way to determine, by querying pg_index and other pg_* tables, whether an index was created as `USING something`? I've already got a big query joining pg_class, pg_index, etc. to pull out various attributes about the indexes in my database, and I'd like to include whether it's a GIST in

Re: [GENERAL] Determine if an index is a B-tree, GIST, or something else?

2013-01-17 Thread Ben Chobot
On Jan 17, 2013, at 10:03 AM, Paul Jungwirth wrote: > Is there any way to determine, by querying pg_index and other pg_* tables, > whether an index was created as `USING something`? I've already got a big > query joining pg_class, pg_index, etc. to pull out various attributes about > the index

Re: [GENERAL] Linux Distribution Preferences?

2013-01-17 Thread Vincent Veyron
Le dimanche 13 janvier 2013 à 18:27 +, Shaun Thomas a écrit : > I'm not sure the last time I saw this discussion, but I was somewhat curious: > what would be your ideal Linux distribution for a nice solid PostgreSQL > installation? We've kinda bounced back and forth between RHEL, CentOS, and

Re: [GENERAL] Determine if an index is a B-tree, GIST, or something else?

2013-01-17 Thread Devrim GÜNDÜZ
Hi, On Thu, 2013-01-17 at 10:03 -0800, Paul Jungwirth wrote: > Is there any way to determine, by querying pg_index and other pg_* tables, > whether an index was created as `USING something`? I've already got a big > query joining pg_class, pg_index, etc. to pull out various attributes about > the

Re: [GENERAL] Determine if an index is a B-tree, GIST, or something else?

2013-01-17 Thread Paul Jungwirth
> pg_indexes (not pg_index) seems to have the data you're looking for, unless I misunderstood the question. That is a lovely table, but I want to get each attribute individually, without having to parse the CREATE INDEX statement. It looks like I was almost there with pg_opclass. This will t

Re: [GENERAL] Determine if an index is a B-tree, GIST, or something else?

2013-01-17 Thread Tom Lane
Paul Jungwirth writes: > So in principle I can just join pg_index, pg_opclass, and pg_am to get my > answer. It's actually a little more complicated because pg_index.indclass > is not an oid, but an oidvector, with one entry for each column in the > index. But unless I'm mistaken, every column in

Re: [GENERAL] Determine if an index is a B-tree, GIST, or something else?

2013-01-17 Thread Paul Jungwirth
> pg_opclass seems the hard way --- just use pg_class.relam, which is > the OID of the index's AM. Ah, that works like a charm. Thanks! Paul

[GENERAL] SELECT DISTINCT

2013-01-17 Thread salah jubeh
Hello Guys, During my work, I have seen a common practice of using DISTINCT . Some will argue that developer should know the effect of using it, but keep in mind not all developers are gurus in RDBMs. Normally, developers work in a narrow domain. Using DISTINCT might lead to a huge performance 

Re: [GENERAL] speeding up a join query that utilizes a view

2013-01-17 Thread Kirk Wythers
> > Not enough information: > > Postgres version? > OS? > Some Postgres configuration parameters, specifically related to "RESOURCE > USAGE" and " QUERY TUNING"? > Table structures (including indexes) for: fifteen_min_stacked_propper, > fifteen_min, and data_key? > View definition for fifteen_m

Re: [GENERAL] String comparison and the SQL standard

2013-01-17 Thread Kevin Grittner
Tom Lane wrote: > This probably has more to do with what these systems think the > data type of an undecorated literal is, than with whether they do > trailing-space-insensitive comparison all the time. I suspect so. Keep in mind that PostgreSQL does not comply with the standard in this regard, b

Re: [GENERAL] speeding up a join query that utilizes a view

2013-01-17 Thread Igor Neyman
What about index definition, Postgres version, config parameters? Hardware configuration would be helpful too. > -Original Message- > From: Kirk Wythers [mailto:kwyth...@umn.edu] > Sent: Thursday, January 17, 2013 3:59 PM > To: Igor Neyman > Cc: Kirk Wythers; pgsql-general@postgresql.org

Re: [GENERAL] speeding up a join query that utilizes a view

2013-01-17 Thread Kirk Wythers
On Jan 17, 2013, at 3:51 PM, Igor Neyman wrote: > What about index definition, Postgres version, config parameters? > Hardware configuration would be helpful too. > Sorry pg 9.1 OS X 10.8 server. 32 G ram 8 cores I thought what you meant by index definition is at the bottom of the \d tabl

[GENERAL] Loggin SQL warnings in JDBC driver

2013-01-17 Thread Edson Richter
I've applyied both paths below to be able to print SQL Warnings when loglevel=1 when working with JDBC 9.2.2 driver. I did create this as separate driver compilation, because I don't want the slowdown introduced in the addWarnings (that would affect significantly my production servers). Using th

Re: [GENERAL] SELECT DISTINCT

2013-01-17 Thread Kevin Grittner
salah jubeh wrote: > During my work, I have seen a common practice of using DISTINCT. > Some will argue that developer should know the effect of using > it, but keep in mind not all developers are gurus in RDBMs. "SELECT DISTINCT eliminates duplicate rows from the result." Personally, I would not

Re: [GENERAL] SELECT DISTINCT

2013-01-17 Thread Tom Lane
"Kevin Grittner" writes: > salah jubeh wrote: >> I think any query that returns a unique column (primary key, >> unique) which is not duplicated in some way (join) can use this >> optimisation technique. > I agree that if the planner searched for that, there would be cases > where the DISTINCT ke