Re: How to assemble all fields of (any) view into a string?

From: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to assemble all fields of (any) view into a string?
Date: 2016-09-08 17:17:11
Message-ID: CAD3a31Um9h7C3dcwVpNTz+43-kPD-pmMSDXhEycdWMb2sFi1Bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 7, 2016 at 4:31 PM, John R Pierce <pierce(at)hogranch(dot)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(at)postgresql(dot)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
*http://agency-software.org/ <http://agency-software.org/>*
*https://agency-software.org/demo/client
<https://agency-software.org/demo/client>*
ken(dot)tanzer(at)agency-software(dot)org
(253) 245-3801

Subscribe to the mailing list
<agency-general-request(at)lists(dot)sourceforge(dot)net?body=subscribe> to
learn more about AGENCY or
follow the discussion.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2016-09-08 19:42:09 Re: 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2
Previous Message Ashish Chauhan 2016-09-08 17:14:47 Re: Setup pgpool-II with streaming replication