last tuple affected

Started by Miguel Angel Tribaldos Hervasabout 21 years ago4 messagesgeneral
Jump to latest
#1Miguel Angel Tribaldos Hervas
mitriher@teleco.upv.es

Hi all!

Two related questions about a problem i'm trying to solve:
How can I know the last tuple affected by an insert/update operation per
table??
Is there exists any function in Postgres for retrieving some hash
value from a table??

Thanks in advance.

--
Miguel �ngel Tribaldos

#2Richard Huxton
dev@archonet.com
In reply to: Miguel Angel Tribaldos Hervas (#1)
Re: last tuple affected

Miguel Angel Tribaldos Hervas wrote:

Hi all!

Two related questions about a problem i'm trying to solve:
How can I know the last tuple affected by an insert/update operation per
table??
Is there exists any function in Postgres for retrieving some hash
value from a table??

You don't define what you mean by "last", and it's not a simple thing.
You could attach triggers to the tables and have them record changes.

Perhaps tell us what you are trying to do, rather than how you want to
do it.
--
Richard Huxton
Archonet Ltd

#3Miguel Angel Tribaldos Hervas
mitriher@teleco.upv.es
In reply to: Richard Huxton (#2)
Re: last tuple affected

I only need to know if a table has changed since the last check
(create, update...), but I want to avoid a trigger + artificial records table.
Is this information recorded somewhere, in a system table perhaps?
What about a hash value refered to any table?

Thanks.

Show quoted text

Miguel Angel Tribaldos Hervas wrote:
Hi all!

Two related questions about a problem i'm trying to solve:
How can I know the last tuple affected by an insert/update operation per
table??
Is there exists any function in Postgres for retrieving some hash
value from a table??

You don't define what you mean by "last", and it's not a simple thing.
You could attach triggers to the tables and have them record changes.

Perhaps tell us what you are trying to do, rather than how you want to
do it.
--
Richard Huxton
Archonet Ltd
--

#4Bruno Wolff III
bruno@wolff.to
In reply to: Miguel Angel Tribaldos Hervas (#3)
Re: last tuple affected

On Thu, Jan 27, 2005 at 12:45:13 +0100,
Miguel Angel Tribaldos Hervas <mitriher@teleco.upv.es> wrote:

I only need to know if a table has changed since the last check
(create, update...), but I want to avoid a trigger + artificial records table.
Is this information recorded somewhere, in a system table perhaps?
What about a hash value refered to any table?

Remember there are different versions of tables that exist at the same time.
If you really want to do the above, you will need to serialize access.