Re: Help with query

From: "Christian Hofmann" <christian(dot)hofmann(at)gmx(dot)de>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Help with query
Date: 2006-01-16 12:56:03
Message-ID: 008301c61a9c$3537d670$9000a8c0@taschenrechner
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello Andreas,

> > Do you know how to solve this error? I need this column.
>
> normalize your table.

But my tables are normalized. In the normal table there is only one state
for a given project_no.
So your queries would success.
But the table we are talking about is a auditing table. It it logging all
events that are going to the normal table.
So it saves when a row is inserted, updated or deleted.
When in the normal table the name for the project_no 1 is altered there will
be also only one row. But in the auditing table (the one I am talking about)
there will be one row for every update, insert or delete in the normal
table.

This is based on the documentation:
http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html

So the example table would be the emp_audit and the normal table the table
emp.

But whzen there is no other possibility I think I will have to fetch all the
rows and do the logic which row is the right one in business logig?

Thank you,

Christian

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ghiz x 2006-01-16 13:04:44 block transactions in stored procedures
Previous Message A. Kretschmer 2006-01-16 06:08:56 Re: Help with query