RE: [pgadmin-support] Re: How to use the SET data type?  Help plz! - Mailing list pgadmin-support

From Dave Page
Subject RE: [pgadmin-support] Re: How to use the SET data type?  Help plz!
Date
Msg-id 03AF4E498C591348A42FC93DEA9661B84C5C64@mail.vale-housing.co.uk
Whole thread Raw
Responses Re: RE: [pgadmin-support] Re: How to use the SET
List pgadmin-support

> -----Original Message-----
> From: pgadmin@claymccoy.com [mailto:pgadmin@claymccoy.com]
> Sent: 27 October 2003 04:17
> To: chriskl@familyhealth.com.au
> Cc: pgadmin-support@postgresql.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
isno different. If it were not done this way then you would not be able to use custom types or domains. As for what
it'sactually 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
supportconstraints. 

The correct way to do what you require is to add check constraints to the table to make sure that the value entered is
withinthe allowed values. If you use the same 'set' a lot, then consider creating a domain which you can then use in
yourtable definitions. 

Regards, Dave.


pgadmin-support by date:

Previous
From: pgadmin@claymccoy.com
Date:
Subject: Re: How to use the SET data type?  Help plz!
Next
From: Jean-Michel POURE
Date:
Subject: Re: dump and restore in pgadmin