Re: array syntax and geometric type syntax - Mailing list pgsql-general

From Scott Bailey
Subject Re: array syntax and geometric type syntax
Date
Msg-id 4A8434C0.1050008@comcast.net
Whole thread Raw
In response to array syntax and geometric type syntax  ("Dan Halbert" <halbert@halwitz.org>)
List pgsql-general
> I am trying to make sense of geometric literal syntax in and out of array syntax. I cannot figure out a general rule:
sometimessingle quotes work, sometimes double quotes work, and inside and outside of array literals the rules are
differentan seemingly inconsistent. 
>
> Examples of all the weird cases are below. If someone could explain what the SQL parser is really looking for, and
whatthe "best" or "most correct" way is, I would be grateful.  

I'm not sure you have a question here that you didn't answer yourself.
Postgres is stricter than most dbms's about typing. It doesn't like to
guess about what you probably meant. It's both a blessing and a curse.
But you get used to it.

You've already gone through what works and what doesn't.  Just do what
works. :) But to answer the question about why the quotes when it is a
point array: Postgres is correctly interpreting and storing your point
arrays. But arrays are output as comma separated lists and since your
points have embedded commas, it quotes them.

Scott

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: array syntax and geometric type syntax
Next
From: Sam Mason
Date:
Subject: Re: Looping through string constants