Re: [GENERAL] select distinct in a subquery bug/problem

2012-08-11 Thread Dan Halbert
On 8/11/2012 2:21 PM, Raymond O'Donnell wrote: On 11/08/2012 04:32, Dan Halbert wrote: 1. select count(t1_id) from t1 where t1_id not in (select distinct t1_id from t2 limit 1103) ==> 13357 [CORRECT result] 2. select count(t1_id) from t1 where t1_id not in (select distinct t1_id

[GENERAL] select distinct in a subquery bug/problem

2012-08-10 Thread Dan Halbert
In version 9.1.4-0ubuntu12.04: Hi - I am getting wrong answers from a certain kind of query, and have narrowed it down to a change in the query plan between two similar queries. The two queries below use different query plans, and generate different results, one of which is completely wrong.

[GENERAL] Indexes on individual columns of composite primary key

2010-11-15 Thread Dan Halbert
I have a table with four columns. Three of those columns are defined as the composite primary key. Does it make sense to create indexes on any or all of those three columns individually for performance reasons? PG does let me create the indexes. But perhaps it's redundant, since there's an impl

Re: [GENERAL] array syntax and geometric type syntax

2009-08-13 Thread Dan Halbert
From "Sam Mason" : >The nicer syntax to distinguish things is to use: > > TYPENAME 'literal' Thanks! That is very helpful. I saw that syntax in one example I found on the web, and incorrectly thought it was an alternate way of writing the function call. The point of all this was to figure out

[GENERAL] array syntax and geometric type syntax

2009-08-13 Thread Dan Halbert
I am trying to make sense of geometric literal syntax in and out of array syntax. I cannot figure out a general rule: sometimes single quotes work, sometimes double quotes work, and inside and outside of array literals the rules are different an seemingly inconsistent. Examples of all the weird