Search Postgresql Archives

Re: How to return argument data type from sql function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 14, 2022 at 2:56 PM Andrus <kobruleht2@xxxxxx> wrote:

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 ?

ColWidth is NOT IMMUTABLE, your declaration of that property is a lie (the function in your email actually defines it as volatile though...).  It is STABLE.

You are basically stuck dealing with this one layer up, outside the server.  You would need to execute ColWidth then write the returned value of the function call into the text body of the SQL Command.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux