Re: [GENERAL] point types in "DISTINCT" queries

2011-06-29 Thread Jonathan S. Katz
> On Wed, 2011-06-29 at 11:37 -0400, Jonathan S. Katz wrote: >> Which means it *should* work, but first I would need to clean up the data >> and find the duplicates. I was hoping this might work: >> >> SELECT geocode, count(*) >> FROM a >>

Re: [GENERAL] point types in "DISTINCT" queries

2011-06-29 Thread Jonathan S. Katz
On Jun 29, 2011, at 10:42 AM, Magnus Hagander wrote: > On Wed, Jun 29, 2011 at 16:38, Jonathan S. Katz > wrote: >> In fact that is my use-case - I will be performing nearest-neighbor lookups >> (and will be running 9.1b2 on this data set shortly). However, because most &g

Re: [GENERAL] point types in "DISTINCT" queries

2011-06-29 Thread Jonathan S. Katz
On Jun 29, 2011, at 10:25 AM, Magnus Hagander wrote: On Wed, Jun 29, 2011 at 06:53, Jeff Davis wrote: On Tue, 2011-06-28 at 18:56 -0400, Jonathan S. Katz wrote: I looked into the mailing list archives and found a potential answer on this thread: http://archives.postgresql.org/pgsql

[GENERAL] point types in "DISTINCT" queries

2011-06-28 Thread Jonathan S. Katz
Hi, I am running PostgreSQL 9.0.4 and I am getting an error with a SELECT DISTINCT query that contains a point type in the SELECT clause. To be more specific, a query such as: -- explicit declaration that it's a point type SELECT DISTINCT a.geocode::point FROM a

Re: [GENERAL] One last Ruby question for tonight - Regarding UUID type

2011-01-30 Thread Jonathan S. Katz
Each database adapter in ActiveRecord sets up a mapping between ActiveRecord types and the native database types. If the type is not defined, it just defaults it as a string. If you are using Rails, in one of your environment initializers, you can add the following code: ActiveRecord::Base.co