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

From pgadmin@claymccoy.com
Subject Re:  How to use the SET data type?  Help plz!
Date
Msg-id 6908255.1067267724205.JavaMail.pgadmin@claymccoy.com
Whole thread Raw
List pgadmin-support
I see your points.  So how is the best way to implement this type of "set" idea
in something like postgres?  Say I have a column named primary colors, and I
want to limit this to red, blue, and yellow.  How is the best way to do this
without a mysql set?

Thanks

> > Odd that it is a selectable datatype in pgadmin then huh?
>
> That's a question for the pgAdmin guys, but I know that PostgreSQL has a
>   type called 'set', which is nothing to do with sets as you understand
> them.
>
> > 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.
>
> Look up CHECK constraints.
>
> Lack of 'MySQL sets' in Postgres is NOT an oversight.  It's a random,
> non-SQL standard type that the MySQL developers made up one day that no
> other database on Earth supports.  Why should Postgres support it?  It's
> just a lame workaround for MySQL not supporting constraints.
>
> (Sorry to sound all worked up about it, but it's one of the things I
> find annoying about MySQL...)
>
> Chris
>
> > Odd that it is a selectable datatype in pgadmin then huh?

That's a question for the pgAdmin guys, but I know that PostgreSQL has a
  type called 'set', which is nothing to do with sets as you understand
them.

> 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.

Look up CHECK constraints.

Lack of 'MySQL sets' in Postgres is NOT an oversight.  It's a random,
non-SQL standard type that the MySQL developers made up one day that no
other database on Earth supports.  Why should Postgres support it?  It's
just a lame workaround for MySQL not supporting constraints.

(Sorry to sound all worked up about it, but it's one of the things I
find annoying about MySQL...)

Chris


pgadmin-support by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: How to use the SET data type? Help plz!
Next
From: Albin Blaschka
Date:
Subject: DBMigration-Wizard & Access 2002