Re: How to assemble all fields of (any) view into a string? - Mailing list pgsql-general

From Ken Tanzer
Subject Re: How to assemble all fields of (any) view into a string?
Date
Msg-id CAD3a31Um9h7C3dcwVpNTz+43-kPD-pmMSDXhEycdWMb2sFi1Bw@mail.gmail.com
Whole thread Raw
In response to Re: How to assemble all fields of (any) view into a string?  (John R Pierce <pierce@hogranch.com>)
List pgsql-general


On Wed, Sep 7, 2016 at 4:31 PM, John R Pierce <pierce@hogranch.com> wrote:
On 9/7/2016 1:36 PM, Ken Tanzer wrote:
No transformation is needed, except for padding the fields out to their maximum lengths.

without accessing metadata, how would you know what those maximum lengths are??

I agree you'd need metadata.  My OP mentioned looking this up in the information schema
 

and how would the calling program even know what the fields are if its not aware of the field lengths?

Do you mean how would the function know?  I didn't see a better way than by explicitly passing the view name.

 
what if a field is type 'text' ? or an array type ?


They won't be.  This has to work for a very specific set of views I've created, not for any view in the universe!

Cheers,
Ken
 

--
john r pierce, recycling bits in santa cruz



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

pgsql-general by date:

Previous
From: Ken Tanzer
Date:
Subject: Re: How to assemble all fields of (any) view into a string?
Next
From: Jeff Janes
Date:
Subject: Re: 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2