Re: How can I expand serialized BLOBs into pseudo columns

From: Joe Conway <mail(at)joeconway(dot)com>
To: Eric Brown <yogieric(at)mac(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How can I expand serialized BLOBs into pseudo columns
Date: 2004-12-05 01:58:41
Message-ID: 41B26B51.60607@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eric Brown wrote:
> SELECT expandobj(obj), * from mytable;
> I get:
> ERROR: cannot display a value of type record
>
> I think/hope I'm missing something pretty stupid, but I can't figure out
> what it might be. Any help would be appreciated. There might even be a
> quite better way.

What you're trying to do isn't supported in 7.4 and earlier. Works in
8.0.0 (which just went RC1) though:

regression=# SELECT expandobj(obj), * from mytable; -- this does not
expandobj | id | obj
-----------+----+-----
(x,y) | 1 | x,y
(1 row)

and so does:
regression=# SELECT (expandobj(obj)).val1, (expandobj(obj)).val2, * from
mytable;
val1 | val2 | id | obj
------+------+----+-----
x | y | 1 | x,y
(1 row)

HTH,

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Henry Molina 2004-12-05 04:53:46 Trigger problem
Previous Message Michael Fuhr 2004-12-04 22:41:20 List archives search function broken