Re: What's the benefit (or usage scenario) of a "typed table"?

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: What's the benefit (or usage scenario) of a "typed table"?
Date: 2017-01-04 04:57:40
Message-ID: d7181a90-873f-6e07-09a2-e5be1accc135@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/31/16 10:34 AM, Thomas Kellerer wrote:
> I recently stumbled over "typed tables" in Postgres
> (there were several questions containing this on stackoverflow recently)
>
> create type some_type as (id integer, data text);
> create table some_table of some_type;
>
> I wonder what the benefit of a typed table is and when this would be useful?

One use is with PL/Proxy. You create the type on the proxy, thus
allowing you to define functions using the type. Then create the table
on the backend from the type, thus ensuring they are the same.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message DrakoRod 2017-01-04 05:01:18 Re: could not load library "$libdir/sslutils": in pg_upgrade process
Previous Message Adrian Klaver 2017-01-04 00:53:10 Re: could not load library "$libdir/sslutils": in pg_upgrade process