sql (Stored procedure) design question

Поиск
Список
Период
Сортировка
От Assad Jarrahian
Тема sql (Stored procedure) design question
Дата
Msg-id 4bd3e1480601112036x2c351782tbdced55161298634@mail.gmail.com
обсуждение исходный текст
Ответы Re: sql (Stored procedure) design question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Problem:
  A column of type text contains username's and groupname's followed
by comma (eg. 'jarraa, mooreg3, keith') [it is stored this way
because it will be displayed in this format].

What is needed is a constrain check. To make sure that every time a
row is inserted into the table, this column (text) gets checked to
make sure that all the username/group name in the text exists in the
db (they are primary key columns of two tables).

I would like to use pgsql to write a stored procedure, but I dont know
how to split the text field up and then send them to do a constrain
check with the other tables.

I initially get this in java and then use jdbc, so if there is a
better way you can think of, feel free to comment.

Any help would be much appreciated. Thanks.


-assad

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: getting access to geodistance (what do I need to install/enable) in an existing db install
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Granting Privleges on All Tables in One Comand?