Re: Help with casting and comparing.

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, jonah(dot)harris(at)gmail(dot)com
Subject: Re: Help with casting and comparing.
Date: 2006-07-06 18:55:21
Message-ID: 20060706185521.GC20946@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 06, 2006 at 07:43:20PM +0300, Tzahi Fadida wrote:
> The downside is that i noticed that the CTID is removed from the tuple
> if a cast occurs. Is there a way to tell postgresql to not remove the
> CTID?

Err, the fact the ctid is removed is really just a side-effect. With no
adjusting of the output, you may just get the actual on-disk tuple. But
as soon as you do some manipulation, you get a new tuple.

> The other way, of course is to add CTID as an attribute in the query
> but it seems less efficient since i am accessing it repeatedly.

If you want the ctid, you have to ask for it.

But this seems a little like premature optimisation. First, make it
work, then make it fast. Once you've got it working you can worry about
performance. Adding an extra column to the output costs very, very
little compared to other things...
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tzahi Fadida 2006-07-06 19:05:57 Re: Help with casting and comparing.
Previous Message Greg Stark 2006-07-06 17:41:53 Re: [GENERAL] UUID's as primary keys