| От | Richard Smith |
|---|---|
| Тема | beginner Table data type question |
| Дата | |
| Msg-id | 39255FA9.B847357B@tampabay.rr.com обсуждение исходный текст |
| Список | pgsql-general |
Hi, I just start using pgsql and I am new to SQL also. I have read lots of documents on this and I cant seem to find the answer, perhaps you can help me. Say I have a table: pgsql=> \d test_table test_table ------------------------------ f1| CHAR (40) f2| CHAR (40) Somewhere down the line I need to change the data type on f2 to CHAR (50) and add constrains like UNIQUE. What is the best was to change tables in this way? Can I just make a new table the way I want and COPY the data out of the old table and COPY it back in? do I use CAST ? Is there some ALTER TABLE tablename MODIFY command I can use? This question has been bugging me for awhile. Because I am new to SQL I find that I make bad design choices about data types and such all the time. So I need to know the best way to change them. Richard
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера