Re: To know what a macro does

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Werner Echezuria <wercool(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: To know what a macro does
Date: 2009-04-26 21:15:29
Message-ID: 20090426211529.GA10795@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 26, 2009 at 04:20:41PM -0430, Werner Echezuria wrote:
> Hi, I've been trying to sort a column that performs some calculations, but
> postgres says this: ERROR: invalid attnum: -12851. I was searching on the
> source code, and I guess the error araises around this macro:

I'm pretty sure this is a "not supposed to happen" thing. Do you have a
repoducable test case? Also, what version of postgres?

> /*
> * Copy the given tuple into memory we control, and decrease availMem.
> * Then call the common code.
> */
> COPYTUP(state, &stup, (void *) slot);
>
> So, I'd like to know what COPYTUP does?, what is availMem?, How can I tell
> postgres it is a valid attnum?

COPYTUP does exactly what the comment says it does. I'm guessing this
is in the sort code somewhere? An "attnum" is a column number, like the
first column is attnum 1. Attnum -12851 is definitly bogus.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-26 21:31:08 Re: Multiple parameters with the same name for functions.
Previous Message Gevik Babakhani 2009-04-26 21:14:52 Re: Multiple parameters with the same name for functions.