From: | "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> |
---|---|
To: | <pgadmin(at)claymccoy(dot)com>, <chriskl(at)familyhealth(dot)com(dot)au> |
Cc: | <pgadmin-support(at)postgresql(dot)org> |
Subject: | RE: [pgadmin-support] Re: How to use the SET data type? Help plz! |
Date: | 2003-10-27 07:49:08 |
Message-ID: | 03AF4E498C591348A42FC93DEA9661B84C5C64@mail.vale-housing.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
> -----Original Message-----
> From: pgadmin(at)claymccoy(dot)com [mailto:pgadmin(at)claymccoy(dot)com]
> Sent: 27 October 2003 04:17
> To: chriskl(at)familyhealth(dot)com(dot)au
> Cc: pgadmin-support(at)postgresql(dot)org
> Subject: [pgadmin-support] Re: How to use the SET data type?
> Help plz!
>
> Odd that it is a selectable datatype in pgadmin then huh?
It's selectable because it's in pg_type. pgAdmin make as few assumptions about the backend as possible - and datatypes is no different. If it were not done this way then you would not be able to use custom types or domains. As for what it's actually there for, I have no idea. Hangover from Berkeley perhaps?
> If there are no sets, then is there anythign else that can be
> used to represent that type of data. I used them a lot in a
> mySQL database that I am migrating from. It is very useful
> to have a predefined set of values to choose from, otherwise
> it would just be a text field with no constraints as to the
> contents. It is also nice to have the popup menus of the
> selecable values when inputing data like how phpmyadmin
> handles sets. It seem slike a huge oversight to not support them.
It's not an oversight, it's a non-spec compliant workaround dreamt up by someone in the MySQL team because they don't support constraints.
The correct way to do what you require is to add check constraints to the table to make sure that the value entered is within the allowed values. If you use the same 'set' a lot, then consider creating a domain which you can then use in your table definitions.
Regards, Dave.
From | Date | Subject | |
---|---|---|---|
Next Message | Jean-Michel POURE | 2003-10-27 09:44:31 | Re: dump and restore in pgadmin |
Previous Message | Együd Csaba | 2003-10-27 05:55:37 | Re: Problems using PGAdmin III |