2016-11-23 10 views
0

次のコマンドを使用して、Unixの機能を説明しています。PostgreSQL 9.5:UNIX端末での機能の説明

\df+ functionName

問題:機能の説明を読み取ることができません。

適切なインデントで関数を表示する方法はありますか。あなたは、キー-Epsql -E)でpsqlを開始し、\df+ functionNameを実行した場合

+0

の可能性のある重複(http://stackoverflow.com/questions/22190772/ system-catalog-is-the-function-body-stored) – teppic

+2

'\ sf functionName'を試してみてください –

答えて

1

、あなたはちょうど\sf functionNameためselect prosrc from pg_proc where proname = 'functionName';'

同じようにそれを照会することができるので、それは、pg_catalog.pg_procから定義を取ることを、表示されます - それはだラップがありますpg_catalog.pg_get_functiondefのためのアップ。

最後に\df+であなたのやり方をすれば、その前に\xを実行してください。Source codeはもっとよく見えます。インデントが保存されているすべてのそれらの場合はとにかく

:[?システムカタログに関数本体が格納されている場合]

b=# create function p() returns text 
b-# as 
b-# $$ 
b$# begin 
b$# --tab 
b$# --two spaces 
b$# --three spaces 
b$# return 't'; 
b$# end; 
b$# $$ language plpgsql 
b-# ; 
CREATE FUNCTION 
b=# \x 
Expanded display is on. 
b=# \df+ p 
List of functions 
-[ RECORD 1 ]-------+------------------ 
Schema    | public 
Name    | p 
Result data type | text 
Argument data types | 
Type    | normal 
Security   | invoker 
Volatility   | volatile 
Owner    | postgres 
Language   | plpgsql 
Source code   |     + 
        | begin   + 
        | --tab   + 
        | --two spaces + 
        | --three spaces+ 
        | return 't'; + 
        | end;    + 
        | 
Description   | 

b=# \sf p 
CREATE OR REPLACE FUNCTION public.p() 
RETURNS text 
LANGUAGE plpgsql 
AS $function$ 
begin 
    --tab 
    --two spaces 
    --three spaces 
    return 't'; 
end; 
$function$ 
関連する問題