BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16
От
PG Bug reporting form
Тема
BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16
Дата
Msg-id
18116-0a17d1321c9d94ea@postgresql.org
Список
Дерево обсуждения
BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16 PG Bug reporting form <noreply@postgresql.org>
Re: BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16 Tom Lane <tgl@sss.pgh.pa.us>
The following bug has been logged on the website:
Bug reference: 18116
Logged by: Wolfgang Launhardt
Email address: wlaunhardt@web.de
PostgreSQL version: 12.16
Operating system: Linux Mint 20.3 Cinnamon
Description:
Please don't send me that again - it is a BUG ! :
"
BUG #18106: Stored Procedure (Text-)Array as INOUT parameter
has been rejected by a moderator and will not be posted.
The reason given for rejection was:
This does not appear to be a bug report."
DO
$$
DECLARE
test text[];
BEGIN
test := '{"x","y","z"}';
CALL ptest( test );
RAISE NOTICE '%', test;
END
$$;
PRODUCES:
ERROR: type with OID 0 does not exist
CONTEXT: SQL statement "CALL ptest( test )" PL/pgSQL function
inline_code_block line 6 at CALL
IN A FUNCTION IT WORKS:
create or replace FUNCTION ptest(INOUT text[] ) returns text[] as 'ptest.so'
language 'c';
C-Source:
#include
#include
#include
#include "postgres.h"
#include "fmgr.h"
#include "funcapi.h"
#include "array.h"
PG_MODULE_MAGIC;
Datum ptest(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(ptest);
Datum
ptest ( PG_FUNCTION_ARGS )
{
ArrayType * arg_arr;
arg_arr = PG_GETARG_ARRAYTYPE_P( 0 );
PG_RETURN_ARRAYTYPE_P( arg_arr );
// TEXTOID = 25 the following code produces the same error:
// PG_RETURN_ARRAYTYPE_P( construct_empty_array( 25 ));
}
В списке pgsql-bugs по дате отправления
От: PG Bug reporting form
Дата:
От: Tom Lane
Дата: