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