Use of pg_proc.probin is legal? - Mailing list pgsql-hackers

From Kohei KaiGai
Subject Use of pg_proc.probin is legal?
Date
Msg-id CADyhKSWFZ3gf6w7P1nTdDteUSHvDc+r_NgpKATjq7d7pPcf65w@mail.gmail.com
Whole thread Raw
Responses Re: Use of pg_proc.probin is legal?
List pgsql-hackers
Hello,

I have a question as subject line.

https://www.postgresql.org/docs/devel/static/catalog-pg-proc.html
According to the documentation, the purpose of pg_proc.probin is
introduced as follows:
| Additional information about how to invoke the function. Again, the
interpretation is language-specific.

On the other hands, interpret_AS_clause() raises an ereport if SQL
function tries to use probin except
for C-language. Is it illegal for other languages to use probin field
to store something useful?

In my case, PL/CUDA language allows to define SQL function with a CUDA
code block.
It saves a raw CUDA source code on the pg_proc.prosrc and its
intermediate representation
on the pg_proc.probin; which is automatically constructed on the
validator callback of the language
handler.

I noticed the problematic scenario because pg_dump generates CREATE
FUNCTION statement
with two AS arguments, then pg_restore tries to run the statement but failed.

Solution seems to me either of them:
1. Admit CREATE FUNCTION with two AS arguments. If language does not
support is, probin is   simply ignored.
2. pg_dump does not dump pg_proc.probin if language is not C-language.
3. Update documentation to inform not to provide the probin if not C-language.

Thanks,
-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Dynamic shared memory areas
Next
From: Mark Kirkwood
Date:
Subject: Re: WIP: About CMake v2