Re: array syntax and geometric type syntax

From: "Dan Halbert" <halbert(at)halwitz(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: array syntax and geometric type syntax
Date: 2009-08-13 16:31:29
Message-ID: 1250181089.741124560@192.168.1.35
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From "Sam Mason" <sam(at)samason(dot)me(dot)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 to figure out a uniform syntax I can use for doing some type adapters to convert back and forth between Python objects and PG objects (through psycopg2 or some other Python-PG interface). Perhaps I should have mentioned that initially. I now see that the '{...}' notation does not do any evaluation of what's inside, e.g.

SELECT '{1,2,1+2}'::INT[];

doesn't work, but

SELECT ARRAY[1,2,1+2]::INT[];

works fine.

Dan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Philip Rhoades 2009-08-13 16:36:07 Re: PostgreSQL for Firefox Bookmarks?
Previous Message Pavel Stehule 2009-08-13 16:15:59 Re: comparing NEW and OLD (any good this way?)