pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Markus Bertheau <twanger@bluetwanger.de>
Cc: postgres sql list <pgsql-sql@postgresql.org>
Cc: Horst Schwarz <schwarz@bab24.de>
Subject: Re: ERROR:  ExecEvalExpr: unknown expression type 108
Date: 30 Jun 2003 12:41:38 -0400
Message-ID: <1056991297.28657.74.camel@jester> (raw)
In-Reply-To: <1056989417.2297.25.camel@fluor>
References: <1056989417.2297.25.camel@fluor>


> 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-01 12: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, compiled by GCC 2.95.4
(1 row)


-- 
Rod Taylor <rbt@rbt.ca>

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

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (4+ messages)  latest in thread

Message-ID: <1056991297.28657.74.camel@jester>
Permalink:  ../1056991297.28657.74.camel@jester/
Also on:    postgresql.org/message-id/1056991297.28657.74.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rbt@rbt.ca, twanger@bluetwanger.de, schwarz@bab24.de
  Subject: Re: ERROR:  ExecEvalExpr: unknown expression type 108
  In-Reply-To: <1056991297.28657.74.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox