Re: array syntax and geometric type syntax

From: Scott Bailey <artacus(at)comcast(dot)net>
To: Dan Halbert <halbert(at)halwitz(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: array syntax and geometric type syntax
Date: 2009-08-13 15:44:00
Message-ID: 4A8434C0.1050008@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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: 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 cases are below. If someone could explain what the SQL parser is really looking for, and what the "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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-08-13 15:48:06 Re: Looping through string constants
Previous Message Sam Mason 2009-08-13 15:43:11 Re: array syntax and geometric type syntax