X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CA15252812 for ; Thu, 23 Jun 2005 14:32:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92758-08 for ; Thu, 23 Jun 2005 17:32:03 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 246A652939 for ; Thu, 23 Jun 2005 14:32:01 -0300 (ADT) Received: from tschibtschibojtschitsch (dsl-084-059-066-190.arcor-ip.net [84.59.66.190]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id j5NHVxV11561 for ; Thu, 23 Jun 2005 19:31:59 +0200 Subject: optimizer, view, union From: Markus Bertheau To: pgsql-sql@postgresql.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-VpeYjpjTus0oXOpS4KJq" Date: Thu, 23 Jun 2005 19:31:57 +0200 Message-Id: <1119547917.7430.12.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.103 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200506/281 X-Sequence-Number: 21882 --=-VpeYjpjTus0oXOpS4KJq Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Can pg transform SELECT * FROM ( SELECT 'foo' AS class, id FROM foo UNION ALL SELECT 'bar' AS class, id FROM bar ) AS a WHERE class =3D 'foo' into SELECT 'foo' AS class, * FROM foo? The subselect is a view here, that's why I don't just use the second query. Markus --=20 Markus Bertheau --=-VpeYjpjTus0oXOpS4KJq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBCuvIN2RUnMPztcykRAitDAJ9wyDyXgBIn5wGBA7Bw225tH7HriwCfXdX+ qPE3ERAoqhcI6O63Iu//EJo= =XZBp -----END PGP SIGNATURE----- --=-VpeYjpjTus0oXOpS4KJq--