Re: ERROR: ExecEvalExpr: unknown expression type 108 - Mailing list pgsql-sql

From Rod Taylor
Subject Re: ERROR: ExecEvalExpr: unknown expression type 108
Date
Msg-id 1056991297.28657.74.camel@jester
Whole thread Raw
In response to ERROR: ExecEvalExpr: unknown expression type 108  (Markus Bertheau <twanger@bluetwanger.de>)
Responses Re: ERROR: ExecEvalExpr: unknown expression type 108
List pgsql-sql
> datetest=# select * from (select (select count(1) from (select von from
> daten union select bis as von from daten) as d1 where d1.von < d2.von)
> as number, von from (select von from daten union select bis as von from
> daten) d2) as table1 join (select (select count(1) + 1 from (select von
> from daten union select bis as von from daten) as d1 where d1.von <
> d2.von) as number, von from (select von from daten union select bis as
> von from daten) d2) as table2 using (number);
> ERROR:  ExecEvalExpr: unknown expression type 108
>
> Is that a bug?

Yes.  Regardless of whether this is a valid SQL statement, it shouldn't
be caught in this manner.

SubSelects have undergone a large simplification by Tom while
implementing read-only plans in the executor.  This seems to have
accidentally fixed this case.

rbt=# create table daten
rbt-# ( id serial not null primary key
rbt(# , menge integer
rbt(# , von timestamp(0) without time zone
rbt(# , bis timestamp(0) without time zone
rbt(# );
NOTICE:  CREATE TABLE will create implicit sequence 'daten_id_seq' for
SERIAL column 'daten.id'
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
'daten_pkey' for table 'daten'
CREATE TABLE
rbt=#
rbt=# INSERT INTO daten
rbt-#      VALUES (DEFAULT, 2, '2000-01-01 10:00:00', '2000-01-01
12:00:00');
INSERT 17132 1
rbt=#
rbt=#
rbt=# INSERT INTO daten
rbt-#      VALUES (DEFAULT, 3, '2000-01-01 11:00:00', '2000-01-01
14:00:00');
INSERT 17133 1
rbt=#
rbt=#
rbt=# INSERT INTO daten
rbt-#      VALUES (DEFAULT, 1, '2000-01-01 14:00:00', '2000-01-01
15:00:00');
INSERT 17134 1
rbt=#
rbt=# INSERT INTO daten
rbt-#      VALUES (DEFAULT, 8, '2000-01-01 12:00:00', '2000-01-01
16:00:00');
INSERT 17135 1
rbt=#
rbt=#
rbt=# INSERT INTO daten
rbt-#      VALUES (DEFAULT, 4, '2000-01-01 10:00:00', '2000-01-01
11:00:00');
INSERT 17136 1
rbt=#
rbt=# select * from (select (select count(1) from (select von from
rbt(# daten union select bis as von from daten) as d1 where d1.von <
d2.von)
rbt(# as number, von from (select von from daten union select bis as von
from
rbt(# daten) d2) as bar join (select (select count(1)+1 from (select von
from
rbt(# daten union select bis as von from daten) as d1 where d1.von <
d2.von)
rbt(# as number, von from (select von from daten union select bis as von
from
rbt(# daten) d2) as foo using (number);number |         von         |         von
--------+---------------------+---------------------     1 | 2000-01-01 11:00:00 | 2000-01-01 10:00:00     2 |
2000-01-0112:00:00 | 2000-01-01 11:00:00     3 | 2000-01-01 14:00:00 | 2000-01-01 12:00:00     4 | 2000-01-01 15:00:00
|2000-01-01 14:00:00     5 | 2000-01-01 16:00:00 | 2000-01-01 15:00:00 
(5 rows)
rbt=# select version();                               version
------------------------------------------------------------------------PostgreSQL 7.4devel on i386-unknown-freebsd4.8,
compiledby GCC 2.95.4 
(1 row)


--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: ERROR: ExecEvalExpr: unknown expression type 108
Next
From: Tom Lane
Date:
Subject: Re: ERROR: ExecEvalExpr: unknown expression type 108