Re: Help with query - Mailing list pgsql-novice

From Christian Hofmann
Subject Re: Help with query
Date
Msg-id 008301c61a9c$3537d670$9000a8c0@taschenrechner
Whole thread Raw
In response to Re: Help with query  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: Help with query  (Andreas Kretschmer <akretschmer@spamfence.net>)
List 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



pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Help with query
Next
From: Ghiz x
Date:
Subject: block transactions in stored procedures