Skip site navigation (1) Skip section navigation (2)

Re: Polymorphic arguments and composite types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic arguments and composite types
Date: 2007-10-05 15:42:20
Message-ID: 17553.1191598940@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> 1. Why doesn't the subselect work?

Because x = ANY (SELECT y FROM ...) is defined by the SQL standard to
involve performing x = y at each row of the SELECT output.  There's
no wiggle room there.

The standard does not specify any meaning for x = ANY (not-a-SELECT)
and we've shoehorned some array behavior into that gap, but it's
completely different semantics.

> 2. Why does a function returning a polymorphic type have to have at
> least one polymorphic argument?

So that the parser can figure out what type a particular call is
supposed to return.

> 3. Why is a composite type with just one attribute not the same type as
> the attribute?

Why in the world would you expect these to be the same?  It'd be akin to
claiming that a one-element array is the same as the element type.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Jeff DavisDate: 2007-10-05 16:17:10
Subject: Re: Polymorphic arguments and composite types
Previous:From: Oleg BartunovDate: 2007-10-05 15:31:34
Subject: Re: default_text_search_config

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group