File: plproxy_target.out

package info (click to toggle)
postgresql-plproxy 2.11.0-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 564 kB
  • sloc: ansic: 3,476; sql: 1,136; lex: 340; yacc: 171; makefile: 93; sh: 18; awk: 14
file content (48 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- test target clause
create function test_target(xuser text, tmp boolean)
returns text as $$
    cluster 'testcluster';
    run on 0;
    target test_target_dst;
$$ language plproxy;
\c test_part0
create function test_target_dst(xuser text, tmp boolean)
returns text as $$
begin
    return 'dst';
end;
$$ language plpgsql;
\c regression
select * from test_target('foo', true);
 test_target 
-------------
 dst
(1 row)

-- test errors
create function test_target_err1(xuser text)
returns text as $$
    cluster 'testcluster';
    run on 0;
    target test_target_dst;
    target test_target_dst;
$$ language plproxy;
ERROR:  PL/Proxy function public.test_target_err1(1): Compile error at line 5: Only one TARGET statement allowed
select * from test_target_err1('asd');
ERROR:  function test_target_err1(unknown) does not exist
LINE 1: select * from test_target_err1('asd');
                      ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
create function test_target_err2(xuser text)
returns text as $$
    cluster 'testcluster';
    run on 0;
    target test_target_dst;
    select 1;
$$ language plproxy;
ERROR:  PL/Proxy function public.test_target_err2(1): Compile error at line 6: TARGET cannot be used with SELECT
select * from test_target_err2('asd');
ERROR:  function test_target_err2(unknown) does not exist
LINE 1: select * from test_target_err2('asd');
                      ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.