"Tjibbe Rijpma" <t.b.rijpma@student.tudelft.nl> writes:
> I want to make a Function as table source. As rettype you have to give a
> composite type but how do I make those?
Best way is
CREATE TYPE typename AS (colname coltype, colname coltype, ...);
> Is this the normal way how to make composite types?
> CREATE TABLE bigint_int_text_timestamp (
> column_1 INT8,
> column_2 INT,
> column_3 TEXT,
> column_4 TIMESTAMP);
You can do that too, since a table declaration creates an associated
rowtype. But if you only intend to use the rowtype and not the actual
table, I think it's more understandable to declare the type as a type.
regards, tom lane