sql (Stored procedure) design question - Mailing list pgsql-general

From Assad Jarrahian
Subject sql (Stored procedure) design question
Date
Msg-id 4bd3e1480601112036x2c351782tbdced55161298634@mail.gmail.com
Whole thread Raw
Responses Re: sql (Stored procedure) design question  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: getting access to geodistance (what do I need to install/enable) in an existing db install
Next
From: Bruce Momjian
Date:
Subject: Re: Granting Privleges on All Tables in One Comand?