基本类型

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=# CREATE OR REPLACE FUNCTION f3 (a_int integer,a_str text) RETURNS VOID AS
postgres-# $$
postgres$# BEGIN
postgres$#     RAISE NOTICE 'a_int = % ; a_str = %',a_int,a_str;
postgres$# END;
postgres$# $$
postgres-# LANGUAGE PLPGSQL;
CREATE FUNCTION
postgres=# SELECT * FROM f3(1,'TDSQL PG');
NOTICE:  a_int = 1 ; a_str = TDSQL PG
 f3
----
(1 行记录)
postgres=# CREATE OR REPLACE FUNCTION f3 (a_int integer[],a_str text[]) RETURNS VOID AS
postgres-# $$
postgres$# BEGIN
postgres$#     RAISE NOTICE 'a_int = % ; a_str = %',a_int,a_str;
postgres$# END;
postgres$# $$
postgres-# LANGUAGE PLPGSQL;
CREATE FUNCTION
postgres=# SELECT f3(ARRAY[1,2,3],ARRAY['TDSQL PG','pgxz']);
NOTICE:  a_int = {1,2,3} ; a_str = {TDSQL PG,pgxz}
 f3
----
(1 行记录)