Re: Typing Records - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Typing Records
Date
Msg-id 4C7365A9.6030200@joeconway.com
Whole thread Raw
In response to Typing Records  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: Typing Records
List pgsql-hackers
On 08/23/2010 08:33 PM, David E. Wheeler wrote:
> I've been trying to come up with a simpler way to iterate over a
> series of values in pgTAP tests than by creating a table, inserting
> rows, and then selecting from the table. The best I've come up with
> so far is:

<snip>

> Aside from that, might there be another way to do this without an
> explicit composite type? Maybe with VALUES() or something?

Maybe something like this?

select cmp_ok(a,b,c)
from
(   values('1.2.2'::varchar,  '='::text, '1.2.2'::varchar),         ('1.2.23', '=', '1.2.23'),         ('1.2.42', '=',
'1.2.32')
) as ss(a, b, c);cmp_ok
--------ttf
(3 rows)

HTH,

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support


pgsql-hackers by date:

Previous
From: igor polishchuk
Date:
Subject: INSERT and parentheses
Next
From: Itagaki Takahiro
Date:
Subject: Re: patch (for 9.1) string functions