Re: Help with casting and comparing. - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Help with casting and comparing.
Date
Msg-id 20060706185521.GC20946@svana.org
Whole thread Raw
In response to Re: Help with casting and comparing.  (Tzahi Fadida <Tzahi.ML@gmail.com>)
Responses Re: Help with casting and comparing.
List 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@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Sander Steffann"
Date:
Subject: Re: [GENERAL] UUID's as primary keys
Next
From: Tzahi Fadida
Date:
Subject: Re: Help with casting and comparing.