Re: [GENERAL] express composite type literal as text

2015-02-27 Thread Jim Nasby
On 2/21/15 7:35 PM, Eric Hanson wrote: Hi, I'm trying to use a composite type in a WHERE clause, as described here: http://www.postgresql.org/docs/9.4/static/rowtypes.html Just pasting in the examples I get: CREATE TYPE complex AS ( r double precision, i double precision

Re: [GENERAL] express composite type literal as text

2015-02-23 Thread Merlin Moncure
On Sat, Feb 21, 2015 at 4:58 PM, Eric Hanson wrote: > Hi, > > I'm trying to use a composite type in a WHERE clause, as described here: > > http://www.postgresql.org/docs/9.4/static/rowtypes.html > > Just pasting in the examples I get: > > CREATE TYPE complex AS ( > r double precision, >

Re: [GENERAL] express composite type literal as text

2015-02-22 Thread Eric Hanson
On Sun, Feb 22, 2015 at 11:42 AM, Adrian Klaver wrote: > > test=> select * from on_hand where item = '("fuzzy > dice",42,1.99)'::inventory_item; > > item | count > +--- > ("fuzzy dice",42,1.99) | 1000 > (1 row) > So, you have to do the explicit c

Re: [GENERAL] express composite type literal as text

2015-02-22 Thread Andrew Sullivan
On Sun, Feb 22, 2015 at 12:18:21PM -0800, Eric Hanson wrote: > Got it. Ok, I'm reporting this as a bug. Is this a bug? Being able to > always express literals as text is a really valuable assumption to be able > to rely on. If I had to guess (I guess someone more authoritative than I will chime

Re: [GENERAL] express composite type literal as text

2015-02-22 Thread Eric Hanson
On Sun, Feb 22, 2015 at 11:47 AM, Tom Lane wrote: > Eric Hanson writes: > > How do I express a composite type literal as text? > > The rules are given in the manual ... > > > I can't use the ROW() notation, because all values need to be represented > > as text over a REST api. But I can't seem

Re: [GENERAL] express composite type literal as text

2015-02-22 Thread Eric Hanson
On Sun, Feb 22, 2015 at 11:42 AM, Adrian Klaver wrote: > > test=> select * from on_hand where item = '("fuzzy > dice",42,1.99)'::inventory_item; > > item | count > +--- > ("fuzzy dice",42,1.99) | 1000 > (1 row) > So, you have to do the explicit c

Re: [GENERAL] express composite type literal as text

2015-02-22 Thread Tom Lane
Eric Hanson writes: > How do I express a composite type literal as text? The rules are given in the manual ... > I can't use the ROW() notation, because all values need to be represented > as text over a REST api. But I can't seem to get the text-based syntax to > work: > select * from on_hand

Re: [GENERAL] express composite type literal as text

2015-02-22 Thread Adrian Klaver
On 02/22/2015 10:07 AM, Eric Hanson wrote: > Hi, > > How do I express a composite type literal as text? > > I'm trying to use a composite type in a WHERE clause. The examples in > the docs > > http://www.postgresql.org/docs/9.4/static/rowtypes.html > > say: > > CREATE TYPE complex AS ( >