![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Executing the following query return an error 'ERROR: unrecognized node ty= pe: 656'. SELECT pg_get_expr(i.indexprs, i.indrelid) AS expr FROM pg_index i INNER JOIN pg_class c ON i.indrelid =3D c.oid WHERE c.relname =3D 'art' |
#2
| |||
| |||
|
|
Executing the following query return an error 'ERROR: unrecognized node type: 656'. SELECT pg_get_expr(i.indexprs, i.indrelid) AS expr FROM pg_index i INNER JOIN pg_class c ON i.indrelid = c.oid WHERE c.relname = 'art' Expression tree is ({FUNCEXPR :funcid 4061872 :funcresulttype 25 :funcretset false :funcformat 0 :args ({RELABELTYPE :arg {VAR :varno 1 :varattno 2 :vartype 1043 :vartypmod 64 :varlevelsup 0 :varnoold 1 :varoattno 2} :resulttype 25 :resulttypmod -1 :relabelformat 1})}) |
#3
| |||
| |||
|
|
"Tom Lane" <tgl (AT) sss (DOT) pgh.pa.us> wrote: I'm not convinced this is really a bug, because pg_index.indexprs is not an expression (it's a list of expressions) and so it's not clear that pg_get_expr should be expected to work on it. What result were you expecting to get? Yes, probably it is not a bug, but only a difference in behavior of function pg_get_expr in versions 7.4 and 8.0. Server 7.4 returns readable representation of index expressions that are combined by 'AND'. |
#4
| |||
| |||
|
|
pg_get_expr() in PostgreSQL 8.0.0beta3 doesn't like the parentheses that surround the expression. This query works for me: SELECT pg_get_expr(trim(BOTH '()' FROM i.indexprs), i.indrelid) AS expr FROM pg_index i INNER JOIN pg_class c ON i.indrelid = c.oid WHERE c.relname = 'art'; pg_get_expr() in PostgreSQL 7.4.5 works both ways. |
|
On Fri, Oct 01, 2004 at 02:46:33PM +0600, Alexander Zhiltsov wrote: Executing the following query return an error 'ERROR: unrecognized node type: 656'. SELECT pg_get_expr(i.indexprs, i.indrelid) AS expr FROM pg_index i INNER JOIN pg_class c ON i.indrelid = c.oid WHERE c.relname = 'art' Expression tree is ({FUNCEXPR :funcid 4061872 :funcresulttype 25 :funcretset false :funcformat 0 :args ({RELABELTYPE :arg {VAR :varno 1 :varattno 2 :vartype |
|
pg_get_expr() in PostgreSQL 8.0.0beta3 doesn't like the parentheses that surround the expression. This query works for me: SELECT pg_get_expr(trim(BOTH '()' FROM i.indexprs), i.indrelid) AS expr FROM pg_index i INNER JOIN pg_class c ON i.indrelid = c.oid WHERE c.relname = 'art'; pg_get_expr() in PostgreSQL 7.4.5 works both ways. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ |
#5
| |||
| |||
|
|
"Tom Lane" <tgl (AT) sss (DOT) pgh.pa.us> wrote: I've fixed it so that 8.0 will return the expressions comma-separated, which seems a reasonably sane behavior. |
|
"Alexander Zhiltsov" <ayz (AT) ems (DOT) ru> writes: "Tom Lane" <tgl (AT) sss (DOT) pgh.pa.us> wrote: I'm not convinced this is really a bug, because pg_index.indexprs is not an expression (it's a list of expressions) and so it's not clear that pg_get_expr should be expected to work on it. What result were you expecting to get? Yes, probably it is not a bug, but only a difference in behavior of function pg_get_expr in versions 7.4 and 8.0. Server 7.4 returns readable representation of index expressions that are combined by 'AND'. Hmm, well that wasn't really the desired behavior either, since the index expressions certainly aren't combined as though by AND. I've fixed it so that 8.0 will return the expressions comma-separated, which seems a reasonably sane behavior. regards, tom lane |
#6
| |||
| |||
|
|
I'm not convinced this is really a bug, because pg_index.indexprs is not an expression (it's a list of expressions) and so it's not clear that pg_get_expr should be expected to work on it. What result were you expecting to get? |
|
"Alexander Zhiltsov" <ayz (AT) ems (DOT) ru> writes: Executing the following query return an error 'ERROR: unrecognized node ty= pe: 656'. SELECT pg_get_expr(i.indexprs, i.indrelid) AS expr FROM pg_index i INNER JOIN pg_class c ON i.indrelid =3D c.oid WHERE c.relname =3D 'art' I'm not convinced this is really a bug, because pg_index.indexprs is not an expression (it's a list of expressions) and so it's not clear that pg_get_expr should be expected to work on it. What result were you expecting to get? regards, tom lane |
![]() |
| Thread Tools | |
| Display Modes | |
| |