pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16
2+ messages / 2 participants
[nested] [flat]
* BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16
@ 2023-09-18 11:46 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2023-09-18 11:46 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: wlaunhardt@web.de
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#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 ));
}
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16
@ 2023-09-18 14:10 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2023-09-18 14:10 UTC (permalink / raw)
To: wlaunhardt@web.de; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> Please don't send me that again - it is a BUG ! :
Maybe, but you haven't shown us a reproducible example.
What I get from the fragments you gave here is
ERROR: ptest(text[]) is not a procedure
LINE 1: CALL ptest( test )
^
HINT: To call a function, use SELECT.
QUERY: CALL ptest( test )
CONTEXT: PL/pgSQL function inline_code_block line 6 at CALL
I suspect that the underlying problem may involve a SQL declaration
for "ptest" that doesn't match what the C code does, so I'm not going
to guess at what you actually used as the SQL declaration. But
clearly it's not what you wrote here.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-09-18 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 11:46 BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16 PG Bug reporting form <noreply@postgresql.org>
2023-09-18 14:10 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox