[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

Re: [GENERAL] array syntax and geometric type syntax

2009-08-13 Thread Sam Mason
On Thu, Aug 13, 2009 at 11:02:37AM -0400, Dan Halbert wrote: 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

Re: [GENERAL] array syntax and geometric type syntax

2009-08-13 Thread Scott Bailey
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

Re: [GENERAL] array syntax and geometric type syntax

2009-08-13 Thread Dan Halbert
From Sam Mason s...@samason.me.uk: 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

Re: [GENERAL] array syntax and geometric type syntax

2009-08-13 Thread Sam Mason
On Thu, Aug 13, 2009 at 12:31:29PM -0400, Dan Halbert wrote: Perhaps I should have mentioned that initially. In retrospect everything is easy! SELECT ARRAY[1,2,1+2]::INT[]; works fine. I'd not put a cast into that one. I can't see any performance reason why it's bad, I think it's mainly