On 5/5/2011 3:26 PM, Rick Genter wrote:
Hm. I think the way I would handle this is to put the business logic
for inserting/updating into the room_assignments table into one or
more functions and have a special user that owns the tables and owns
the functions and declare the functions to be SE
I think the best way is what David has suggested...
But if it is already live, and there is no way to handle clients app to work
with functions (instead of Direct SQL statements) then I think trigger
function would help... (not sure how it could be error prone..)
So basically if function is
Val
On Thu, May 5, 2011 at 4:14 PM, Jack Christensen wrote:
> It's not denormalized. It is an attribute that both tables have that have
> to match for it to be a valid link.
>
> Here's a contrived example:
>
> CREATE TABLE dorms(
> dorm_id serial PRIMARY KEY,
> gender varchar NOT NULL,
> ...
> )
On 5/5/2011 2:53 PM, Rick Genter wrote:
On Thu, May 5, 2011 at 3:50 PM, Jack Christensen
mailto:ja...@hylesanderson.edu>> wrote:
The trick is there are additional attributes of actions and
achievements such as a category that must match for the link to be
valid. These attributes are
On Thu, May 5, 2011 at 3:50 PM, Jack Christensen wrote:
> The trick is there are additional attributes of actions and achievements
> such as a category that must match for the link to be valid. These
> attributes are not part of the primary key of either record and can and do
> change.
>
So your
On 5/5/2011 2:28 PM, Rick Genter wrote:
On Thu, May 5, 2011 at 3:20 PM, Jack Christensen
mailto:ja...@hylesanderson.edu>> wrote:
What is the best way to handle multiple table relationships where
attributes of the tables at the ends of the chain must match?
Example:
CREATE TABL
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Jack Christensen
> Sent: Thursday, May 05, 2011 3:20 PM
> To: pgsql
> Subject: [GENERAL] Multiple table relationship constraints
>
> 4. Validate application side -- t
On Thu, May 5, 2011 at 3:20 PM, Jack Christensen wrote:
> What is the best way to handle multiple table relationships where
> attributes of the tables at the ends of the chain must match?
>
> Example:
>
> CREATE TABLE achievements(
> achievement_id serial PRIMARY KEY,
> ...
> );
>
> CREATE TABLE a