Re: inheritance, and plans

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: inheritance, and plans
Date: 2009-02-07 17:23:40
Message-ID: 2f4958ff0902070923n5aca9cd7k9a623b1032b6f372@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

so Tom,
with a little help on Irc from Andrew (RhodiumToad) I got it 'fixed',
but I know this is just a hack:

Index: src/backend/utils/adt/selfuncs.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v
retrieving revision 1.258
diff -u -r1.258 selfuncs.c
--- src/backend/utils/adt/selfuncs.c 1 Jan 2009 17:23:50 -0000 1.258
+++ src/backend/utils/adt/selfuncs.c 7 Feb 2009 17:20:21 -0000
@@ -3392,7 +3392,7 @@
static double
convert_numeric_to_scalar(Datum value, Oid typid)
{
- switch (typid)
+ switch (getBaseType(typid))
{
case BOOLOID:
return (double) DatumGetBool(value);
ndex: src/backend/optimizer/path/allpaths.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v
retrieving revision 1.179
diff -u -r1.179 allpaths.c
--- src/backend/optimizer/path/allpaths.c 1 Jan 2009 17:23:43 -0000 1.179
+++ src/backend/optimizer/path/allpaths.c 7 Feb 2009 17:21:25 -0000
@@ -33,6 +33,9 @@
#include "parser/parse_clause.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteManip.h"
+#include "utils/lsyscache.h"
+#include "utils/syscache.h"
+

/* These parameters are set by GUC */
@@ -1042,7 +1045,7 @@
continue; /* ignore resjunk columns */
if (colType == NULL)
elog(ERROR, "wrong number of tlist entries");
- if (exprType((Node *) tle->expr) != lfirst_oid(colType))
+ if (exprType((Node *) tle->expr) != lfirst_oid(colType) &&
getBaseType(exprType((Node *) tle->expr)) != lfirst_oid(colType))
differentTypes[tle->resno] = true;
colType = lnext(colType);
}

This is just a hack, and I know it won't work. But the question is, is
it possible to fix it ?
I think something should convert types to base type somewhere up the
call level. Perhaps we should pass on oid of type+baseType ?

I also noticed that the convert_numeric_to_scalar() family of
functions is considered a future change too, atm everything there is
hardcoded pretty much.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-02-07 17:39:24 Re: inheritance, and plans
Previous Message Robert Haas 2009-02-07 16:36:32 Re: explanation of some configs