|
409 | 409 | $$;
|
410 | 410 | NOTICE: a: <NULL>, b: {30,7}
|
411 | 411 | NOTICE: _a: 37, _b: 30, _c: 7
|
| 412 | +-- polymorphic OUT arguments |
| 413 | +CREATE PROCEDURE test_proc12(a anyelement, OUT b anyelement, OUT c anyarray) |
| 414 | +LANGUAGE plpgsql |
| 415 | +AS $$ |
| 416 | +BEGIN |
| 417 | + RAISE NOTICE 'a: %', a; |
| 418 | + b := a; |
| 419 | + c := array[a]; |
| 420 | +END; |
| 421 | +$$; |
| 422 | +DO $$ |
| 423 | +DECLARE _a int; _b int; _c int[]; |
| 424 | +BEGIN |
| 425 | + _a := 10; |
| 426 | + CALL test_proc12(_a, _b, _c); |
| 427 | + RAISE NOTICE '_a: %, _b: %, _c: %', _a, _b, _c; |
| 428 | +END |
| 429 | +$$; |
| 430 | +NOTICE: a: 10 |
| 431 | +NOTICE: _a: 10, _b: 10, _c: {10} |
| 432 | +DO $$ |
| 433 | +DECLARE _a int; _b int; _c text[]; |
| 434 | +BEGIN |
| 435 | + _a := 10; |
| 436 | + CALL test_proc12(_a, _b, _c); -- error |
| 437 | + RAISE NOTICE '_a: %, _b: %, _c: %', _a, _b, _c; |
| 438 | +END |
| 439 | +$$; |
| 440 | +ERROR: procedure test_proc12(integer, integer, text[]) does not exist |
| 441 | +LINE 1: CALL test_proc12(_a, _b, _c) |
| 442 | + ^ |
| 443 | +HINT: No procedure matches the given name and argument types. You might need to add explicit type casts. |
| 444 | +QUERY: CALL test_proc12(_a, _b, _c) |
| 445 | +CONTEXT: PL/pgSQL function inline_code_block line 5 at CALL |
412 | 446 | -- transition variable assignment
|
413 | 447 | TRUNCATE test1;
|
414 | 448 | CREATE FUNCTION triggerfunc1() RETURNS trigger
|
|
0 commit comments