| От | Steven Klassen |
|---|---|
| Тема | Re: Newbie table definition question |
| Дата | |
| Msg-id | 20041017030604.GA23312@commandprompt.com обсуждение исходный текст |
| Ответ на | Re: Newbie table definition question (Ken Tozier <kentozier@comcast.net>) |
| Список | pgsql-general |
* Ken Tozier <kentozier@comcast.net> [2004-10-16 22:52:10 -0400]: > Or is it one of those things that enforces data integrity behind the > scenes? That's exactly it -- one of the most attractive things about the database is that if constraints are defined appropriately it can defend itself from the programmer. ;) xinu=> insert into grocery_items (grocery_types_id, name, price) values (100, 'Roast Beef', 5.50); ERROR: insert or update on table "grocery_items" violates foreign key constraint "grocery_types_id_exists" DETAIL: Key (grocery_types_id)=(100) is not present in table "grocery_types". -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication & Support Services, (503) 667-4564
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера