Re: [HACKERS] To know what a macro does

2009-04-27 Thread Werner Echezuria
2009/4/28 Tom Lane > Well, you've omitted showing us the code where the problem is likely to > be, but I am kinda thinking that you've shot yourself in the foot by > trying to represent your special ordering clause as a simple constant. > The planner is quite smart enough to throw away "order by

Re: [HACKERS] To know what a macro does

2009-04-27 Thread Tom Lane
Werner Echezuria writes: > Later in planner.c on grouping_planner function I do something like this: Well, you've omitted showing us the code where the problem is likely to be, but I am kinda thinking that you've shot yourself in the foot by trying to represent your special ordering clause as a s

Re: [HACKERS] To know what a macro does

2009-04-27 Thread Werner Echezuria
Well, I'm in a project called PostgreSQLf and we're trying to include fuzzy logic inside PostgreSQL. Now I've been thinking this is getting too hard, do you know if I can just sort the results with something like this : Sort(ResultSlot,column)?, I mean without the Order By clause? 2009/4/28 Martij

Re: [HACKERS] To know what a macro does

2009-04-26 Thread Martijn van Oosterhout
On Sun, Apr 26, 2009 at 08:33:42PM -0430, Werner Echezuria wrote: > Well, I do a query like this: "SELECT * FROM historial WHERE > id_grupo=grupo_hist ORDER BY grmemb LIMIT 10;", then in transformSortClause > I know it this way: Ok, this is way over my head. But really, it would be helpful to know

Re: [HACKERS] To know what a macro does

2009-04-26 Thread Werner Echezuria
Well, I do a query like this: "SELECT * FROM historial WHERE id_grupo=grupo_hist ORDER BY grmemb LIMIT 10;", then in transformSortClause I know it this way: /* * transformSortClause - * transform an ORDER BY clause * * ORDER BY items will be added to the targetlist (as resjunk columns)

Re: [HACKERS] To know what a macro does

2009-04-26 Thread Martijn van Oosterhout
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 sur

[HACKERS] To know what a macro does

2009-04-26 Thread Werner Echezuria
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: /* * Copy the given tuple into memory we control, and decrease availMem. * Th