Received: from roura.ac.upc.es (roura.ac.upc.es [147.83.33.10]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1F8mlx62865; Thu, 15 Feb 2001 03:48:47 -0500 (EST) (envelope-from vmuntes@ac.upc.es) Received: from pons (pons.ac.upc.es [147.83.32.9]) by roura.ac.upc.es (8.11.0/8.11.0) with SMTP id f1F8mHG08903; Thu, 15 Feb 2001 09:48:17 +0100 (MET) Message-ID: <3A8B97D1.41C6@ac.upc.es> Date: Thu, 15 Feb 2001 09:48:17 +0100 From: Victor Muntes Mutero X-Mailer: Mozilla 3.04 (X11; U; OSF1 V4.0 alpha) MIME-Version: 1.0 To: pgsql-sql@postgresql.org CC: pgsql-general@postgresql.org, pgsql-admin@postgresql.org Subject: TPCH questions Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200102/98 X-Sequence-Number: 698 Hello, we have got a problem when executing some queries of tpch benchmark on PostgreSQL. For instance, the postgres parser do not accept the syntax of the query number 9: select nation2 , o_year, sum(amount) as sum_profit from ( select n_name as nation2, extract(year from o_orderdate) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part, supplier, lineitem, partsupp, orders, nation where s_suppkey = l_suppkey and ps_suppkey = l_suppkey and ps_partkey = l_partkey and p_partkey = l_partkey and o_orderkey = l_orderkey and s_nationkey = n_nationkey and p_name like '%green%' ) as profit group by nation2, o_year order by nation2, o_year desc; Postgres returns the following message: ERROR: parser: parse error at or near "select" We have tried to solve the problem and we have seen that simplifying, the real problem shows up when trying to solve a query like this one: select * from (select * from supplier); (for example) What's the problem? We've heard about some variants of TPCH queries, do you know if there is any of these which could solve our problem? Thanks in advance, Victor Muntes Pep Aguilar