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

domains missing some default castings

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: domains missing some default castings
Date: 2008-04-15 14:04:14
Message-ID: 162867790804150704u551dd1c0y9d517f75243bd29f@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello

When I derive domain from some type I expect same castings rules.
Minimally for literals. But it's not true:

CREATE DOMAIN sixc AS char(6) NOT NULL;

CREATE OR REPLACE FUNCTION fxx(sixc)
RETURNS sixc AS $$
SELECT 'abcdef'; -- Actual return type is unknown.
$$ LANGUAGE SQL;
SELECT fxx('abcdef');

-- ok
CREATE OR REPLACE FUNCTION fxx(sixc)
RETURNS char(6) AS $$
SELECT 'abcdef';
$$ LANGUAGE SQL;

Regards
Pavel Stehule

pgsql-bugs by date

Next:From: Eugen.KonkovDate: 2008-04-16 11:13:55
Subject: BUG: Protocol 3.0: that's just odd, needing to add the number of bytes the length field occupies
Previous:From: Gildas PRIMEDate: 2008-04-15 12:47:38
Subject: BUG #4108: PgInstaller Update modify install paths in Registry

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