pg.ddx.io  pgsql-students@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tzahi Fadida <tzahifadida@gmail.com>
To: pgsql-students@postgresql.org
Subject: Questions
Date: Wed, 31 May 2006 18:45:47 +0200
Message-ID: <037b01c684d1$ab072000$0b00a8c0@llord> (raw)

First,
Good luck to everyone.

I have a postgresql question.

My C function can run for a very very long time on some
inputs and reiterate on relations using SPI.
Basically, I open portals and cursors to relations
and use tuplestores. Also note that I always open the
relations in READ ONLY mode using SPI.

I have a great need to identify a tuple uniquely so
my prototype uses the CTID field for that purpose.

The question is, can the CTID field change throughout
the run of my function due to some other processes working
on the relation? Or because of command bounderies it is
pretty much secured inside an implicit transaction.
The problem wasn't so great if I didn't want to exploit
indices in the relations (but I do and does), since 
after you issue a SELECT that uses indices, all you can rely on
is the CTID to uniquely identify a tuple.

The other solution is to temporarily duplicate the relations but
I don't like this very much.


Regards,
	Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at http://members.lycos.co.uk/my2nis/spamwarning.html





view thread (9+ messages)  latest in thread

Message-ID: <037b01c684d1$ab072000$0b00a8c0@llord>
Permalink:  ../037b01c684d1$ab072000$0b00a8c0@llord/
Also on:    postgresql.org/message-id/037b01c684d1$ab072000$0b00a8c0@llord

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-students@postgresql.org
  Cc: tzahifadida@gmail.com
  Subject: Re: Questions
  In-Reply-To: <037b01c684d1$ab072000$0b00a8c0@llord>
  References: <037b01c684d1$ab072000$0b00a8c0@llord>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox