| От | Filipe Bonjour |
|---|---|
| Тема | Can arrays reference primary keys in CREATE TABLE? |
| Дата | |
| Msg-id | pan.2003.05.09.21.21.24.908732@urbanet.ch обсуждение |
| Ответы |
Re: Can arrays reference primary keys in CREATE TABLE?
|
| Список | pgsql-sql |
Hi, I'm a rather new SQL user, and I found interesting that you can use "references" to make sure that a value inserted in a table is a primary key from another table. Something like: create table ta ( a_id integer primary key ); create table tb ( a_ref integer references ta(a_id) ); However, I'd like to define a table containing an array, and that all elements of the array be a primary key from another table, so I tried: create table tb ( a_ref integer[] references ta(a_id) ); But that doesn't work, I think because an array of integers can't be directly compared to an integer. Is there a way to do this? (I'm using Red Hat 9 with PostgreSQL 7.3.2, by the way.) Thanks in advance for any answer or for pointing our where I can find it. Fil
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера