Error in parser with UNIONS.

Chris Albertson <chris@topdog.pas1.logicon.com>

From: Chris Albertson <chris@topdog.pas1.logicon.com>
To: pgsql-hackers@hub.org
Date: 1998-05-21T22:39:14Z
Lists: pgsql-hackers
Got no reply on "questions".  Someone here may want to
know this...

I think I may have uncovered an error in the parser.  The 
following is the simplest example that shows the problem.
Maybe a counter needs to be reset by 'union' or checked
after select not statement.  I would like to use this syntax
in my libpq program.  Is this a bug?  Is it already known?

Would someone please e-mail me the syntax for the
"explicit cast" the system wants

I am using 6.3.2 on an Ultra SPARC.  The error occurs on
a Linux RH50 Intel system too.

I think the following should work but does not:

   testdb=> select 'a' as X 
   testdb-> union
   testdb-> select 'b' as X;
   NOTICE:  there is more than one operator < for types
   NOTICE:  unknown and unknown. You will have to retype this query
   ERROR:  using an explicit cast

Notice that this does work
 
   testdb=>  select 'b' as X;
   x
   -
   b
   (1 row)

And this works too:

   testdb=> select 1 as X
   testdb-> union
   testdb-> select 2 as X;
   x
   -
   1
   2
   (2 rows)


-- 
--Chris Albertson

  chris@topdog.logicon.com                Voice:  626-351-0089  X127
  Logicon RDA, Pasadena California          Fax:  626-351-0699