| From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
|---|---|
| To: | Tjibbe Rijpma <t(dot)b(dot)rijpma(at)student(dot)tudelft(dot)nl> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: how to create a composite type as return type for a |
| Date: | 2004-12-13 02:09:13 |
| Message-ID: | 20041212180735.K11498@megazone.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Thu, 9 Dec 2004, Tjibbe Rijpma wrote:
> I want to make a Function as table source. As rettype you have to give a
> composite type but how do I make those? I'm using an new empty table with
> the the datatypes (INT, INT8, TEXT and a TIMESTAMP) I need.
>
> Is this the normal way how to make composite types?
>
> Example:
>
> CREATE TABLE bigint_int_text_timestamp (
> column_1 INT8,
> column_2 INT,
> column_3 TEXT,
> column_4 TIMESTAMP);
I'd normally use CREATE TYPE AS.
CREATE TYPE bigint_int_text_timestamp AS (
column_1 int8,
column_2 int,
column_3 text,
column_4 timestamp);
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-12-13 02:39:43 | Re: how to create a composite type as return type for a Function as Table Source |
| Previous Message | Michael Fuhr | 2004-12-12 03:22:04 | Re: can't set sequence |