Re: Typing Records
От | Tom Lane |
---|---|
Тема | Re: Typing Records |
Дата | |
Msg-id | 28150.1282658749@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Typing Records ("David E. Wheeler" <david@kineticode.com>) |
Ответы |
Re: Typing Records
|
Список | pgsql-hackers |
"David E. Wheeler" <david@kineticode.com> writes: > 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: > CREATE TYPE vcmp AS ( lv semver, op text, rv semver); > SELECT cmp_ok(lv, op, rv) FROM unnest(ARRAY[ > ROW('1.2.2', '=', '1.2.2')::vcmp, > ROW('1.2.23', '=', '1.2.23')::vcmp > ]); > Not bad, but I was hoping that I could cast all the rows at once, You could do it like this: SELECT cmp_ok(lv, op, rv) FROM unnest(ARRAY[ ROW('1.2.2', '=', '1.2.2'), ROW('1.2.23', '=', '1.2.23') ]::vcmp[]); > psql:t/types.pg:205: ERROR: invalid memory alloc request size 18446744071604011012 > Wha?? > That seems like a bug. I get a core dump on that one ... looking ... regards, tom lane
В списке pgsql-hackers по дате отправления: