Re: To know what a macro does - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: To know what a macro does
Date
Msg-id 20090426211529.GA10795@svana.org
Whole thread Raw
In response to To know what a macro does  (Werner Echezuria <wercool@gmail.com>)
Responses Re: To know what a macro does  (Werner Echezuria <wercool@gmail.com>)
List 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@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Gevik Babakhani
Date:
Subject: Re: Multiple parameters with the same name for functions.
Next
From: Tom Lane
Date:
Subject: Re: Multiple parameters with the same name for functions.