Re: How to return argument data type from sql function - Mailing list pgsql-general

From Andrus
Subject Re: How to return argument data type from sql function
Date
Msg-id b6519a3e-76f3-85d5-c9aa-c79c5d119524@hot.ee
Whole thread Raw
In response to Re: How to return argument data type from sql function  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: How to return argument data type from sql function
List pgsql-general
> Adrian Klaver recommends in
Padding a text typed output with actual significant spaces "works"?  It is not equivalent to a bpchar with insignificant padding spaces...

You are right. I need char(n) type and this is not working.  How to use expression in cast, like

select torus(charcol) :: CHAR( ColWidth('public', 'test',  'charcol')  ) from test

This throws error in Postgres. ColWidth is immutable and called with constant arguments so it should work. How to fix postgres to allow constant ColWidth() expression in cast ?

Andrus.

pgsql-general by date:

Previous
From: Andrus
Date:
Subject: Re: How to return argument data type from sql function
Next
From: "David G. Johnston"
Date:
Subject: Re: How to return argument data type from sql function