Why do subselects in target lists behave differently wrt implicit casts?

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Why do subselects in target lists behave differently wrt implicit casts?
Date: 2004-07-07 17:31:01
Message-ID: 40EC3355.80801@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is a really trivial question, but I'm curious. Why do
subselects in target lists behave differently than simple queries?

Ex:

[lexus] create temporary table bar (key varchar(32) not null);
CREATE TABLE
[lexus] insert into bar select '';
INSERT 1319585 1
[lexus] insert into bar select (select '') as key;
ERROR: failed to find conversion function from "unknown" to
character varying
[lexus] insert into bar select (select ''::text) as key;
INSERT 1319586 1

Just curious,

Mike Mascari

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-07-07 17:32:08 Re: Getting user who fired a trigger
Previous Message Richard Huxton 2004-07-07 17:28:41 Re: Help with query: indexes on timestamps