Re: Create type

From: "Eric G(dot) Miller" <egm2(at)jps(dot)net>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Create type
Date: 2001-02-27 08:50:45
Message-ID: 20010227005045.A8214@calico.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 27, 2001 at 09:11:43AM +0100, Renaud Tthonnart wrote:
> Richard Huxton wrote:
> >
> > Sorry Renaud, I'm not sure it's clear what you're trying to do.
> > Could you post an example of what you're trying to achieve to the
> > list? That'd probably help
>
> Ok. First I wanted to use nested tables. But I think it is not
> possible.
>
> Then I decided to create a type that will made the same function, a
> type that will be like a C structure. This type would contain an
> integer and a string like (1,'aaa'). Then I would have made a list or
>
> an array with this type. Am I clear? Sorry if not, my English is
> poor.

I think the original question still stands. What are you trying do?
Can't you map your "structure" to a regular table? A list of struct's
containing one integer and one string sounds like a table containing
one integer and one string (with the possible addition of an extra
key field if the integer is not already an identifier).

CREATE TABLE list_struct (
i integer NOT NULL,
c varchar(255) NOT NULL
CHECK (char_length(c) > 0),
PRIMARY KEY (i, c)
);

--
Eric G. Miller <egm2(at)jps(dot)net>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jose Manuel Lorenzo Lopez 2001-02-27 09:13:18 Re: Permission denied while insert
Previous Message Renaud Tthonnart 2001-02-27 08:11:43 RE:Create type