Skip site navigation (1) Skip section navigation (2)

RE: [pgadmin-support] Re: How to use t?==?iso-8859-1?Q?he SET data type?  Help plz!

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 t?==?iso-8859-1?Q?he SET data type?  Help plz!
Date: 2003-10-27 07:49:08
Message-ID: (view raw, whole thread or download thread mbox)
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.


pgadmin-support by date

Next:From: Jean-Michel POUREDate: 2003-10-27 09:44:31
Subject: Re: dump and restore in pgadmin
Previous:From: Együd CsabaDate: 2003-10-27 05:55:37
Subject: Re: Problems using PGAdmin III

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group