Sample Header Ad - 728x90

PostgreSQL CREATE TYPE using multiple relations?

0 votes
1 answer
209 views
I'm becoming familiar with PostgreSQL's ability to define a data type https://www.postgresql.org/docs/current/sql-createtype.html using CREATE TYPE syntax. It appears to me that this type does not allow to compose a type out of relations/tables. In other words, I can do this: CREATE TYPE compfoo AS (f1 int, f2 text); but I can't do CREATE TYPE compfoo AS (f1 relation, f2 relation); I was wondering if my understanding is correct, and if not, how one could achieve the latter? I want to indicate that I don't have any particular application for it. I would actually be interested in starting a discussion on an application! I am just trying to expand my understanding of this feature which is often touted as a very powerful feature in the extensible DBMS world.
Asked by Zeruno (547 rep)
Jul 5, 2019, 04:48 PM
Last activity: Jun 19, 2025, 11:01 PM