how can i change my table/column constraint

Поиск
Список
Период
Сортировка
От Muhammad Rusydi
Тема how can i change my table/column constraint
Дата
Msg-id 003e01c0d530$032e8220$1102a8c0@windows
обсуждение исходный текст
Ответы Re: how can i change my table/column constraint  (Anand Raman <araman@india-today.com>)
Re: how can i change my table/column constraint  ("Eric G. Miller" <egm2@jps.net>)
Список pgsql-general
Hi,
if i have created this tables:
create table lab (
kd_lab varchar(4) check (kd_lab ~'[0][1-4][0-9][0-9]'),
name varchar(10),
primary key (kd_lab));

create table tb2 (
kd_lab varchar(4) references lab (kd_lab),
tb2 varchar(10),
primary key (kd_lab));

the questions is if i want to change the check constraint to
[0][1-5][0-9][0-9]
how can i do this?
if i create another table named lab2 with same fields and then i move
all tuples from lab to lab2, then drop table lab and rename lab2 to
lab, is the references constraint in table tb2 still valid?
would you show me how to do this?

TIA
Didi


В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: how can i get plpgsql in function?
Следующее
От: Anand Raman
Дата:
Сообщение: Re: how can i change my table/column constraint