sql (Stored procedure) design question

From: Assad Jarrahian <jarraa(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: sql (Stored procedure) design question
Date: 2006-01-12 04:36:02
Message-ID: 4bd3e1480601112036x2c351782tbdced55161298634@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-01-12 04:43:17 Re: Granting Privleges on All Tables in One Comand?
Previous Message Michael Fuhr 2006-01-12 04:09:26 Re: getting access to geodistance (what do I need to install/enable) in an existing db install