[pgadmin-support] Re: How to use the SET data type? Help plz!
Odd that it is a selectable datatype in pgadmin then huh? 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. > U...PostgreSQL doesn't support sets... > > Chris > > [EMAIL PROTECTED] wrote: > > > When I add a column a table I am able to choose the SET DataType, but there is > > no obvious way to define the acceptable values for the set. > > I'd like to use the gui that I use for creating all my other columns rather > > than doing it by hand. The generated sql from the gui doesn't even seem right > > because it puts set in quotes. I can't even enter sql by hand that should add > > a set with values, of course my syntax might not be right as I can't seem to > > find a good example for creating a set. > > Can anyone help me in using sets with pgadmin? > > > > ---(end of broadcast)--- > > TIP 4: Don't 'kill -9' the postmaster > > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECTED] so that your > message can get through to the mailing list cleanly > --- Begin Message --- U...PostgreSQL doesn't support sets... Chris [EMAIL PROTECTED] wrote: When I add a column a table I am able to choose the SET DataType, but there is no obvious way to define the acceptable values for the set. I'd like to use the gui that I use for creating all my other columns rather than doing it by hand. The generated sql from the gui doesn't even seem right because it puts set in quotes. I can't even enter sql by hand that should add a set with values, of course my syntax might not be right as I can't seem to find a good example for creating a set. Can anyone help me in using sets with pgadmin? ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly --- End Message --- ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
[pgadmin-support] RE: [pgadmin-support] Re: How to use the SET data type? Help plz!
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 27 October 2003 04:17 > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > 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. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [pgadmin-support] dump and restore in pgadmin
Le Lundi 27 Octobre 2003 05:11, [EMAIL PROTECTED] a écrit : > Does pgadmin have support for dumping and restoring a database? Not yet. The feature request is on the to-do list. http://snake.pgadmin.org/pgadmin3/development.php#todo At present, you have to log on the database server and run pg_dump manually. Best regards, Jean-Michel ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [pgadmin-support] RE: [pgadmin-support] Re: How to use the SET
Dave Page wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 04:17 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] 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? Very easily answered, just have a look at the comment on the datatype. It says "set of tuples", so this type can hold a complete table. Regards, Andreas ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [pgadmin-support] How to use the SET data type? Help plz!
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?
CREATE TABLE foo (
color varchar(255) NOT NULL,
CHECK (color IN ('red', 'blue', 'yellow'))
};
Chris
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
[pgadmin-support] Re: How to use the SET data type? Help plz!
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 > > --- Begin Message --- 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 --- End Message --- ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
