-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-psql.html
More file actions
2986 lines (2979 loc) · 294 KB
/
Copy pathapp-psql.html
File metadata and controls
2986 lines (2979 loc) · 294 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>psql</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PostgreSQL 9.5.4文書" /><link rel="up" href="reference-client.html" title="PostgreSQLクライアントアプリケーション" /><link rel="prev" href="app-pgrestore.html" title="pg_restore" /><link rel="next" href="app-reindexdb.html" title="reindexdb" /><link rel="copyright" href="legalnotice.html" title="法的告知" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left" colspan="2"></td><th width="60%" align="center"><a accesskey="h" href="index.html">PostgreSQL 9.5.4文書</a></th><td width="20%" align="right"><div class="actions"><a class="issue" href="https://github.com/pgsql-jp/jpug-doc/issues/new?title=version 9.5.4 app-psql.html">誤訳等の報告</a></div></td></tr><tr><td width="10%" align="left" valign="top"><a accesskey="p" href="app-pgrestore.html">前へ</a> </td><td width="10%" align="left" valign="top"><a accesskey="u" href="reference-client.html">上へ</a></td><td width="60%" align="center"><span class="application">psql</span></td><td width="20%" align="right" valign="top"> <a accesskey="n" href="app-reindexdb.html">次へ</a></td></tr></table><hr /></div><div class="refentry" id="app-psql"><div class="titlepage"></div><a id="idp108416688" class="indexterm"></a><div class="refnamediv"><h2>名前</h2><p><span class="application">psql</span> — <span class="original">
<productname>PostgreSQL</productname> interactive terminal
</span><span class="productname">PostgreSQL</span>の対話的ターミナル
</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="idp108421456"><code class="command">psql</code> [<em class="replaceable"><code>option</code></em>...] [<em class="replaceable"><code>dbname</code></em>
[<em class="replaceable"><code>username</code></em>]]</p></div></div><div class="refsect1" id="idp108426112"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p><span class="original">
<application>psql</application> is a terminal-based front-end to
<productname>PostgreSQL</productname>. It enables you to type in
queries interactively, issue them to
<productname>PostgreSQL</productname>, and see the query results.
Alternatively, input can be from a file. In addition, it provides a
number of meta-commands and various shell-like features to
facilitate writing scripts and automating a wide variety of tasks.
</span><span class="application">psql</span>とは<span class="productname">PostgreSQL</span>のターミナル型フロントエンドです。
対話的に問い合わせを入力し、それを<span class="productname">PostgreSQL</span>に対して発行して、結果を確認することができます。
また、ファイルから入力を読み込むことも可能です。
さらに、スクリプトの記述を簡便化したり、様々なタスクを自動化したりする、いくつものメタコマンドとシェルに似た各種の機能を備えています。
</p></div><div class="refsect1" id="r1-app-psql-3"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-a</code><br /></span><span class="term"><code class="option">--echo-all</code></span></dt><dd><p><span class="original">
Print all nonempty input lines to standard output as they are read.
(This does not apply to lines read interactively.) This is
equivalent to setting the variable <varname>ECHO</varname> to
<literal>all</literal>.
</span>読み込んだ全ての空でない入力行を標準出力に表示します。
(これは対話式に読み込まれる行には適用されません。)
これは<code class="varname">ECHO</code>変数を<code class="literal">all</code>に設定するのと同じ意味を持ちます。
</p></dd><dt><span class="term"><code class="option">-A</code><br /></span><span class="term"><code class="option">--no-align</code></span></dt><dd><p><span class="original">
Switches to unaligned output mode. (The default output mode is
otherwise aligned.)
</span>位置揃えなしの出力モードに切り替えます
(デフォルトの出力モードは位置揃えありです)。
</p></dd><dt><span class="term"><code class="option">-b</code><br /></span><span class="term"><code class="option">--echo-errors</code></span></dt><dd><p><span class="original">
Print failed SQL commands to standard error output. This is
equivalent to setting the variable <varname>ECHO</varname> to
<literal>errors</literal>.
</span>失敗したSQLコマンドを標準エラー出力に出力します。
これは<code class="varname">ECHO</code>変数を<code class="literal">errors</code>に設定するのと同等です。
</p></dd><dt><span class="term"><code class="option">-c <em class="replaceable"><code>command</code></em></code><br /></span><span class="term"><code class="option">--command=<em class="replaceable"><code>command</code></em></code></span></dt><dd><p><span class="original">
Specifies that <application>psql</application> is to execute one
command string, <replaceable class="parameter">command</replaceable>,
and then exit. This is useful in shell scripts. Start-up files
(<filename>psqlrc</filename> and <filename>~/.psqlrc</filename>) are
ignored with this option.
</span><span class="application">psql</span>に対し、<em class="replaceable"><code>command</code></em>という1つのコマンド文字列を実行し、終了するよう指示します。
このコマンドはシェルスクリプト内で有用です。
このオプションを使用すると起動ファイル(<code class="filename">psqlrc</code>および<code class="filename">~/.psqlrc</code>)は無視されます。
</p><p><span class="original">
<replaceable class="parameter">command</replaceable> must be either
a command string that is completely parsable by the server (i.e.,
it contains no <application>psql</application>-specific features),
or a single backslash command. Thus you cannot mix
<acronym>SQL</acronym> and <application>psql</application>
meta-commands with this option. To achieve that, you could
pipe the string into <application>psql</application>, for example:
<literal>echo '\x \\ SELECT * FROM foo;' | psql</literal>.
(<literal>\\</> is the separator meta-command.)
</span><em class="replaceable"><code>command</code></em>は、サーバで完全に解析可能な(つまり、<span class="application">psql</span>特有の機能は含まない)コマンド文字列、もしくは、バックスラッシュコマンド1つである必要があります。
このため、このオプションでは<acronym class="acronym">SQL</acronym>と<span class="application">psql</span>メタコマンドを混在させることはできません。
これらを同時に使用するには、例えば、<code class="literal">echo '\x \\ SELECT * FROM foo;' | psql</code>のようにパイプを使って文字列を<span class="application">psql</span>に渡します(<code class="literal">\\</code>はメタコマンドの区切り文字です。)。
</p><p><span class="original">
If the command string contains multiple SQL commands, they are
processed in a single transaction, unless there are explicit
<command>BEGIN</>/<command>COMMIT</> commands included in the
string to divide it into multiple transactions. This is
different from the behavior when the same string is fed to
<application>psql</application>'s standard input. Also, only
the result of the last SQL command is returned.
</span>コマンド文字列が複数のSQLコマンドを含む場合、トランザクションを複数に分ける<code class="command">BEGIN</code>/<code class="command">COMMIT</code>コマンドが明示的に文字列内に含まれない限り、それらのコマンドは1つのトランザクションで処理されます。
これは、同じ文字列を<span class="application">psql</span>の標準入力として渡した場合の動作とは異なります。
また最後のSQLコマンドの結果のみが返されます。
</p><p><span class="original">
Because of these legacy behaviors, putting more than one command in
the <option>-c</option> string often has unexpected results. It's
better to feed multiple commands to <application>psql</application>'s
standard input, either using <application>echo</application> as
illustrated above, or via a shell here-document, for example:
</span>これらの従来的な動作のため、<code class="option">-c</code>の文字列に2つ以上のコマンドを指定すると、予期しない結果をもたらすことがあります。
上記のように<span class="application">echo</span>を使うか、あるいは以下の例のようにシェルのヒアドキュメントを使って、<span class="application">psql</span>の標準入力に複数のコマンドを入力する方が良いでしょう。
</p><pre class="programlisting">psql <<EOF
\x
SELECT * FROM foo;
EOF</pre><p>
</p></dd><dt><span class="term"><code class="option">-d <em class="replaceable"><code>dbname</code></em></code><br /></span><span class="term"><code class="option">--dbname=<em class="replaceable"><code>dbname</code></em></code></span></dt><dd><p><span class="original">
Specifies the name of the database to connect to. This is
equivalent to specifying <replaceable
class="parameter">dbname</replaceable> as the first non-option
argument on the command line.
</span>接続するデータベースの名前を指定します。
コマンドラインでオプション以外の最初の引数として<em class="replaceable"><code>dbname</code></em>を指定するのと同じ効力を持ちます。
</p><p><span class="original">
If this parameter contains an <symbol>=</symbol> sign or starts
with a valid <acronym>URI</acronym> prefix
(<literal>postgresql://</literal>
or <literal>postgres://</literal>), it is treated as a
<parameter>conninfo</parameter> string. See <xref
linkend="libpq-connstring"> for more information.
</span>このパラメータに<code class="symbol">=</code>記号が含まれる場合、または有効な<acronym class="acronym">URI</acronym>接頭辞(<code class="literal">postgresql://</code>または<code class="literal">postgres://</code>)から始まる場合<em class="parameter"><code>conninfo</code></em>文字列として扱われます。
詳しくは<a class="xref" href="libpq-connect.html" title="31.1. データベース接続制御関数">31.1. データベース接続制御関数</a>を参照してください。
</p></dd><dt><span class="term"><code class="option">-e</code><br /></span><span class="term"><code class="option">--echo-queries</code></span></dt><dd><p><span class="original">
Copy all SQL commands sent to the server to standard output as well.
This is equivalent
to setting the variable <varname>ECHO</varname> to
<literal>queries</literal>.
</span>サーバに送られるすべてのSQLコマンドを標準出力にも送ります。
<code class="varname">ECHO</code>変数を<code class="literal">queries</code>に設定するのと同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-E</code><br /></span><span class="term"><code class="option">--echo-hidden</code></span></dt><dd><p><span class="original">
Echo the actual queries generated by <command>\d</command> and other backslash
commands. You can use this to study <application>psql</application>'s
internal operations. This is equivalent to
setting the variable <varname>ECHO_HIDDEN</varname> to <literal>on</>.
</span><code class="command">\d</code>やその他のバックスラッシュコマンドによって生成される実際の問い合わせを表示します。
これを使って、<span class="application">psql</span>の内部動作を調べることができます。
これは変数<code class="varname">ECHO_HIDDEN</code>を<code class="literal">on</code>に設定するのと同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-f <em class="replaceable"><code>filename</code></em></code><br /></span><span class="term"><code class="option">--file=<em class="replaceable"><code>filename</code></em></code></span></dt><dd><p><span class="original">
Use the file <replaceable class="parameter">filename</replaceable>
as the source of commands instead of reading commands interactively.
After the file is processed, <application>psql</application>
terminates. This is in many ways equivalent to the meta-command
<command>\i</command>.
</span>対話式にコマンドを読み取るのではなく、<em class="replaceable"><code>filename</code></em>ファイルをコマンドの入力元として使用します。
このファイルの処理が終了した後、<span class="application">psql</span>は終了します。
これは<code class="command">\i</code>メタコマンドとほぼ同じ効力を持ちます。
</p><p><span class="original">
If <replaceable>filename</replaceable> is <literal>-</literal>
(hyphen), then standard input is read until an EOF indication
or <command>\q</> meta-command. Note however that Readline
is not used in this case (much as if <option>-n</option> had been
specified).
</span><em class="replaceable"><code>filename</code></em>に<code class="literal">-</code>(ハイフン)を指定すると、標準入力からEOFを示すもの、または<code class="command">\q</code>メタコマンドまで読み取られます。
この場合、Readlineは使われないことに注意してください(<code class="option">-n</code>が指定された場合と同様です)。
</p><p><span class="original">
Using this option is subtly different from writing <literal>psql
&lt; <replaceable
class="parameter">filename</replaceable></literal>. In general,
both will do what you expect, but using <literal>-f</literal>
enables some nice features such as error messages with line
numbers. There is also a slight chance that using this option will
reduce the start-up overhead. On the other hand, the variant using
the shell's input redirection is (in theory) guaranteed to yield
exactly the same output you would have received had you entered
everything by hand.
</span>このオプションを指定するのと、<code class="literal">psql < <em class="replaceable"><code>filename</code></em></code>と入力するのでは、微妙に動作が異なります。
一般的には、両者とも期待通りの動作を行いますが、<code class="literal">-f</code>を使用した場合は、エラーメッセージに行番号を付けるなどいくつか便利な機能が有効になります。
また、このオプションを使用した場合、起動時のオーバーヘッドが減少する可能性が若干あります。
一方、シェルの入力リダイレクションを使用する方法では、(理論的には)全て手作業で入力した場合の出力とまったく同一な出力になることが保証されます。
</p></dd><dt><span class="term"><code class="option">-F <em class="replaceable"><code>separator</code></em></code><br /></span><span class="term"><code class="option">--field-separator=<em class="replaceable"><code>separator</code></em></code></span></dt><dd><p><span class="original">
Use <replaceable class="parameter">separator</replaceable> as the
field separator for unaligned output. This is equivalent to
<command>\pset fieldsep</command> or <command>\f</command>.
</span><em class="replaceable"><code>separator</code></em>を位置揃えを行わない出力におけるフィールド区切り文字として使用します。
<code class="command">\pset fieldsep</code>もしくは<code class="command">\f</code>と同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-h <em class="replaceable"><code>hostname</code></em></code><br /></span><span class="term"><code class="option">--host=<em class="replaceable"><code>hostname</code></em></code></span></dt><dd><p><span class="original">
Specifies the host name of the machine on which the
server is running. If the value begins
with a slash, it is used as the directory for the Unix-domain
socket.
</span>サーバを実行しているマシンのホスト名を指定します。
この値がスラッシュから始まる場合、Unixドメインソケット用のディレクトリとして使用されます。
</p></dd><dt><span class="term"><code class="option">-H</code><br /></span><span class="term"><code class="option">--html</code></span></dt><dd><p><span class="original">
Turn on <acronym>HTML</acronym> tabular output. This is
equivalent to <literal>\pset format html</literal> or the
<command>\H</command> command.
</span><acronym class="acronym">HTML</acronym>表形式を有効にします。
<code class="literal">\pset format html</code>もしくは<code class="command">\H</code>コマンドと同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-l</code><br /></span><span class="term"><code class="option">--list</code></span></dt><dd><p><span class="original">
List all available databases, then exit. Other non-connection
options are ignored. This is similar to the meta-command
<command>\list</command>.
</span>利用可能な全てのデータベースを一覧表示し、終了します。
この他の接続に関連しないオプションは無視されます。
<code class="command">\list</code>メタコマンドと似た効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-L <em class="replaceable"><code>filename</code></em></code><br /></span><span class="term"><code class="option">--log-file=<em class="replaceable"><code>filename</code></em></code></span></dt><dd><p><span class="original">
Write all query output into file <replaceable
class="parameter">filename</replaceable>, in addition to the
normal output destination.
</span>すべての問い合わせの出力を通常の出力先に出力し、さらにファイル<em class="replaceable"><code>filename</code></em>に書き出します。
</p></dd><dt><span class="term"><code class="option">-n</code><br /></span><span class="term"><code class="option">--no-readline</code></span></dt><dd><p><span class="original">
Do not use <application>Readline</application> for line editing and do
not use the command history.
This can be useful to turn off tab expansion when cutting and pasting.
</span>行編集用の<span class="application">Readline</span>を使用しません。
またコマンド履歴も使用しません。
コピー&ペースト時のタブ展開を無効にするために有用かもしれません。
</p></dd><dt><span class="term"><code class="option">-o <em class="replaceable"><code>filename</code></em></code><br /></span><span class="term"><code class="option">--output=<em class="replaceable"><code>filename</code></em></code></span></dt><dd><p><span class="original">
Put all query output into file <replaceable
class="parameter">filename</replaceable>. This is equivalent to
the command <command>\o</command>.
</span>全ての問い合わせの出力を<em class="replaceable"><code>filename</code></em>ファイルに書き込みます。
これは<code class="command">\o</code>コマンドと同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>port</code></em></code><br /></span><span class="term"><code class="option">--port=<em class="replaceable"><code>port</code></em></code></span></dt><dd><p><span class="original">
Specifies the TCP port or the local Unix-domain
socket file extension on which the server is listening for
connections. Defaults to the value of the <envar>PGPORT</envar>
environment variable or, if not set, to the port specified at
compile time, usually 5432.
</span>サーバが接続監視を行っているTCPポートもしくはローカルUnixドメインソケットファイルの拡張子を指定します。
環境変数<code class="envar">PGPORT</code>の値、環境変数が設定されていない場合はコンパイル時に指定した値(通常は5432)がデフォルト値となります。
</p></dd><dt><span class="term"><code class="option">-P <em class="replaceable"><code>assignment</code></em></code><br /></span><span class="term"><code class="option">--pset=<em class="replaceable"><code>assignment</code></em></code></span></dt><dd><p><span class="original">
Specifies printing options, in the style of
<command>\pset</command>. Note that here you
have to separate name and value with an equal sign instead of a
space. For example, to set the output format to <application>LaTeX</application>, you could write
<literal>-P format=latex</literal>.
</span><code class="command">\pset</code>形式により表示オプションを指定します。
ここでは空白ではなく等号を使って名前と値を区切っていることに注意してください。
たとえば、出力形式を<span class="application">LaTeX</span>にする場合、<code class="literal">-P format=latex</code>と入力します。
</p></dd><dt><span class="term"><code class="option">-q</code><br /></span><span class="term"><code class="option">--quiet</code></span></dt><dd><p><span class="original">
Specifies that <application>psql</application> should do its work
quietly. By default, it prints welcome messages and various
informational output. If this option is used, none of this
happens. This is useful with the <option>-c</option> option.
This is equivalent to setting the variable <varname>QUIET</varname>
to <literal>on</>.
</span><span class="application">psql</span>がメッセージ出力なしで処理を行うように指示します。
デフォルトでは、ウェルカム(welcome)メッセージや各種の情報が表示されますが、
このオプションを使用した場合、これらのメッセージが表示されません。
<code class="option">-c</code>オプションと併用すると便利です。
これは変数<code class="varname">QUIET</code>を<code class="literal">on</code>に設定するのと同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-R <em class="replaceable"><code>separator</code></em></code><br /></span><span class="term"><code class="option">--record-separator=<em class="replaceable"><code>separator</code></em></code></span></dt><dd><p><span class="original">
Use <replaceable class="parameter">separator</replaceable> as the
record separator for unaligned output. This is equivalent to the
<command>\pset recordsep</command> command.
</span><em class="replaceable"><code>separator</code></em>を位置揃えを行わない出力におけるレコード区切り文字として使用します。
これは<code class="command">\pset recordsep</code>コマンドと同じです。
</p></dd><dt><span class="term"><code class="option">-s</code><br /></span><span class="term"><code class="option">--single-step</code></span></dt><dd><p><span class="original">
Run in single-step mode. That means the user is prompted before
each command is sent to the server, with the option to cancel
execution as well. Use this to debug scripts.
</span>シングルステップモードで実行します。
これは各コマンドがサーバに送信される前に、ユーザに対して実行するかキャンセルするかについて確認を求めることを意味します。
スクリプトのデバッグを行う時に使用してください。
</p></dd><dt><span class="term"><code class="option">-S</code><br /></span><span class="term"><code class="option">--single-line</code></span></dt><dd><p><span class="original">
Runs in single-line mode where a newline terminates an SQL command, as a
semicolon does.
</span>シングル行モードで実行します。このモードでは、セミコロンと同じように改行もSQLコマンドの終端として扱われます。
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">注記</h3><p><span class="original">
This mode is provided for those who insist on it, but you are not
necessarily encouraged to use it. In particular, if you mix
<acronym>SQL</acronym> and meta-commands on a line the order of
execution might not always be clear to the inexperienced user.
</span>このモードはどうしてもこのような方式を使用したいユーザ向けに用意されたもので、必ずしも使用が推奨されるわけではありません。
特に、1行に<acronym class="acronym">SQL</acronym>とメタコマンドを混在させる場合、経験の浅いユーザにとってその実行順番は必ずしもわかりやすいものではありません。
</p></div></dd><dt><span class="term"><code class="option">-t</code><br /></span><span class="term"><code class="option">--tuples-only</code></span></dt><dd><p><span class="original">
Turn off printing of column names and result row count footers,
etc. This is equivalent to the <command>\t</command> command.
</span>列名と結果の行数フッタなどの表示を無効にします。
これは、<code class="command">\t</code>コマンドとまったく同じ効力を持ちます。
</p></dd><dt><span class="term"><code class="option">-T <em class="replaceable"><code>table_options</code></em></code><br /></span><span class="term"><code class="option">--table-attr=<em class="replaceable"><code>table_options</code></em></code></span></dt><dd><p><span class="original">
Specifies options to be placed within the
<acronym>HTML</acronym> <sgmltag>table</sgmltag> tag. See
<command>\pset</command> for details.
</span><acronym class="acronym">HTML</acronym>の<code class="sgmltag-element">table</code>タグで使用されるオプションを指定します。
詳細は<code class="command">\pset</code>を参照してください。
</p></dd><dt><span class="term"><code class="option">-U <em class="replaceable"><code>username</code></em></code><br /></span><span class="term"><code class="option">--username=<em class="replaceable"><code>username</code></em></code></span></dt><dd><p><span class="original">
Connect to the database as the user <replaceable
class="parameter">username</replaceable> instead of the default.
(You must have permission to do so, of course.)
</span>デフォルトのユーザではなく<em class="replaceable"><code>username</code></em>ユーザとしてデータベースに接続します
(当然、そうする権限を持っていなければなりません)。
</p></dd><dt><span class="term"><code class="option">-v <em class="replaceable"><code>assignment</code></em></code><br /></span><span class="term"><code class="option">--set=<em class="replaceable"><code>assignment</code></em></code><br /></span><span class="term"><code class="option">--variable=<em class="replaceable"><code>assignment</code></em></code></span></dt><dd><p><span class="original">
Perform a variable assignment, like the <command>\set</command>
meta-command. Note that you must separate name and value, if
any, by an equal sign on the command line. To unset a variable,
leave off the equal sign. To set a variable with an empty value,
use the equal sign but leave off the value. These assignments are
done during a very early stage of start-up, so variables reserved
for internal purposes might get overwritten later.
</span><code class="command">\set</code>メタコマンドのように、変数の代入を行います。
値がある場合、コマンド行上では、名前と値を等号(=)で区切る必要があることに注意してください。
変数を未設定の状態にするには、等号を指定しないでください。
値が空の変数を設定するには、値を指定しないで等号のみ使用してください。
これらの代入は起動時の非常に早い段階で行われます。
そのため、内部で使用するために予約されている変数は後で上書きされる可能性があります。
</p></dd><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p><span class="original">
Print the <application>psql</application> version and exit.
</span><span class="application">psql</span>のバージョンを表示し、終了します。
</p></dd><dt><span class="term"><code class="option">-w</code><br /></span><span class="term"><code class="option">--no-password</code></span></dt><dd><p><span class="original">
Never issue a password prompt. If the server requires password
authentication and a password is not available by other means
such as a <filename>.pgpass</filename> file, the connection
attempt will fail. This option can be useful in batch jobs and
scripts where no user is present to enter a password.
</span>パスワードの入力を促しません。
サーバがパスワード認証を必要とし、かつ、<code class="filename">.pgpass</code>ファイルなどの他の方法が利用できない場合、接続試行は失敗します。
バッチジョブやスクリプトなどパスワードを入力するユーザが存在しない場合にこのオプションは有用かもしれません。
</p><p><span class="original">
Note that this option will remain set for the entire session,
and so it affects uses of the meta-command
<command>\connect</command> as well as the initial connection attempt.
</span>このオプションはセッション全体にわたって設定されたままであることに注意してください。
このため<code class="command">\connect</code>メタコマンドの使用に関しても初期接続試行と同様に影響します。
</p></dd><dt><span class="term"><code class="option">-W</code><br /></span><span class="term"><code class="option">--password</code></span></dt><dd><p><span class="original">
Force <application>psql</application> to prompt for a
password before connecting to a database.
</span>データベースに接続する前に、<span class="application">psql</span>は強制的にパスワード入力を促します。
</p><p><span class="original">
This option is never essential, since <application>psql</application>
will automatically prompt for a password if the server demands
password authentication. However, <application>psql</application>
will waste a connection attempt finding out that the server wants a
password. In some cases it is worth typing <option>-W</> to avoid
the extra connection attempt.
</span>サーバがパスワード認証を要求する場合<span class="application">psql</span>は自動的にパスワード入力を促しますので、これが重要になることはありません。
しかし、<span class="application">psql</span>は、サーバにパスワードが必要かどうかを判断するための接続試行を無駄に行います。
こうした余計な接続試行を防ぐために<code class="option">-W</code>の入力が有意となる場合もあります。
</p><p><span class="original">
Note that this option will remain set for the entire session,
and so it affects uses of the meta-command
<command>\connect</command> as well as the initial connection attempt.
</span>このオプションはセッション全体に対して設定されたままであることに注意してください。
このため初期接続試行と同様に<code class="command">\connect</code>メタコマンドの使用にも影響を与えます。
</p></dd><dt><span class="term"><code class="option">-x</code><br /></span><span class="term"><code class="option">--expanded</code></span></dt><dd><p><span class="original">
Turn on the expanded table formatting mode. This is equivalent to the
<command>\x</command> command.
</span>拡張テーブル形式モードを有効にします。
これは<code class="command">\x</code>コマンドと同じです。
</p></dd><dt><span class="term"><code class="option">-X,</code><br /></span><span class="term"><code class="option">--no-psqlrc</code></span></dt><dd><p><span class="original">
Do not read the start-up file (neither the system-wide
<filename>psqlrc</filename> file nor the user's
<filename>~/.psqlrc</filename> file).
</span>起動用ファイル(<code class="filename">psqlrc</code>ファイルおよびユーザ用の<code class="filename">~/.psqlrc</code>ファイルのどちらも)を読み込みません。
</p></dd><dt><span class="term"><code class="option">-z</code><br /></span><span class="term"><code class="option">--field-separator-zero</code></span></dt><dd><p><span class="original">
Set the field separator for unaligned output to a zero byte.
</span>位置揃えを行わない出力用のフィールド区切り文字をゼロバイトに設定します。
</p></dd><dt><span class="term"><code class="option">-0</code><br /></span><span class="term"><code class="option">--record-separator-zero</code></span></dt><dd><p><span class="original">
Set the record separator for unaligned output to a zero byte. This is
useful for interfacing, for example, with <literal>xargs -0</literal>.
</span>位置揃えを行わない出力用のレコード区切り文字をゼロバイトに設定します。
これは例えば<code class="literal">xargs -0</code>と連携する時に有用です。
</p></dd><dt><span class="term"><code class="option">-1</code><br /></span><span class="term"><code class="option">--single-transaction</code></span></dt><dd><p><span class="original">
When <application>psql</application> executes a script, adding
this option wraps <command>BEGIN</>/<command>COMMIT</> around the
script to execute it as a single transaction. This ensures that
either all the commands complete successfully, or no changes are
applied.
</span>このオプションで起動された<span class="application">psql</span>でスクリプトを実行するとき、スクリプトの前後を<code class="command">BEGIN</code>/<code class="command">COMMIT</code>で囲み、単一トランザクションとして実行します。
これによりすべてのコマンドが完全に成功するか、変更がまったく行われないかのいずれかになります。
</p><p><span class="original">
If the script itself uses <command>BEGIN</>, <command>COMMIT</>,
or <command>ROLLBACK</>, this option will not have the desired
effects.
Also, if the script contains any command that cannot be executed
inside a transaction block, specifying this option will cause that
command (and hence the whole transaction) to fail.
</span>スクリプト内部で<code class="command">BEGIN</code>、<code class="command">COMMIT</code>、<code class="command">ROLLBACK</code>を使用している場合、このオプションは想定した効果をもたらしません。
また、スクリプト内部にトランザクションブロック内部で実行することができないコマンドが含まれている場合、このオプションを指定することで、そのコマンドは失敗(そしてそのためにトランザクション全体が失敗)します。
</p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help[=<em class="replaceable"><code>topic</code></em>]</code></span></dt><dd><p><span class="original">
Show help about <application>psql</application> and exit. The optional
<replaceable class="parameter">topic</> parameter (defaulting
to <literal>options</literal>) selects which part of <application>psql</application> is
explained: <literal>commands</> describes <application>psql</>'s
backslash commands; <literal>options</> describes the command-line
options that can be passed to <application>psql</>;
and <literal>variables</> shows help about <application>psql</application> configuration
variables.
</span><span class="application">psql</span>に関するヘルプを表示し、終了します。
オプションの<em class="replaceable"><code>topic</code></em>パラメータ(デフォルトは<code class="literal">options</code>)は<span class="application">psql</span>のどの部分を説明するかを選択します。
<code class="literal">commands</code>は<span class="application">psql</span>のバックスラッシュコマンドについて、<code class="literal">options</code>は<span class="application">psql</span>に渡すことができるコマンド行オプションについて、<code class="literal">variables</code>は<span class="application">psql</span>の設定変数についてのヘルプを表示します。
</p></dd></dl></div></div><div class="refsect1" id="idp108591296"><h2>終了ステータス</h2><span class="original">
<title>Exit Status</title>
</span><p><span class="original">
<application>psql</application> returns 0 to the shell if it
finished normally, 1 if a fatal error of its own occurs (e.g. out of memory,
file not found), 2 if the connection to the server went bad
and the session was not interactive, and 3 if an error occurred in a
script and the variable <varname>ON_ERROR_STOP</varname> was set.
</span><span class="application">psql</span>は、正常に終了した時には0を、<span class="application">psql</span>にとって致命的なエラー(メモリ不足やファイルが見つからないなど)が発生した時には1を、セッションが対話式でない状態でサーバとの接続が不完全になった時には2を、<code class="varname">ON_ERROR_STOP</code>変数が設定されている状態でスクリプトでエラーが発生した時には3をシェルに返します。
</p></div><div class="refsect1" id="idp108594816"><h2>使用方法</h2><span class="original">
<title>Usage</title>
</span><div class="refsect2" id="r2-app-psql-connecting"><h3>データベースへの接続</h3><span class="original">
<title>Connecting to a Database</title>
</span><p><span class="original">
<application>psql</application> is a regular
<productname>PostgreSQL</productname> client application. In order
to connect to a database you need to know the name of your target
database, the host name and port number of the server, and what user
name you want to connect as. <application>psql</application> can be
told about those parameters via command line options, namely
<option>-d</option>, <option>-h</option>, <option>-p</option>, and
<option>-U</option> respectively. If an argument is found that does
not belong to any option it will be interpreted as the database name
(or the user name, if the database name is already given). Not all
of these options are required; there are useful defaults. If you omit the host
name, <application>psql</> will connect via a Unix-domain socket
to a server on the local host, or via TCP/IP to <literal>localhost</> on
machines that don't have Unix-domain sockets. The default port number is
determined at compile time.
Since the database server uses the same default, you will not have
to specify the port in most cases. The default user name is your
operating-system user name, as is the default database name.
Note that you cannot
just connect to any database under any user name. Your database
administrator should have informed you about your access rights.
</span><span class="application">psql</span>は<span class="productname">PostgreSQL</span>の正式なクライアントアプリケーションです。
データベースに接続するには、接続するデータベース名、ホスト名、サーバのポート番号、接続する際に使用するユーザ名がわかっていなければなりません。
<span class="application">psql</span>では、それらをコマンドラインオプションで指定することができます。接続するデータベース名は<code class="option">-d</code>、ホスト名は<code class="option">-h</code>、サーバのポート番号は<code class="option">-p</code>、接続するユーザ名は<code class="option">-U</code>を使用してそれぞれ指定します。
オプションでない引数がある場合、それはデータベース名(データベース名が与えられている場合にはユーザ名)とみなされます。
これらのオプションは全て指定されている必要はありません。便利なデフォルト値があります。
ホスト名を省略した場合、<span class="application">psql</span>はUnixドメインソケット経由でローカルホスト上のサーバに、Unixドメインソケットを持たないマシンでは<code class="literal">localhost</code>にTCP/IP経由で接続します。
デフォルトのポート番号はコンパイル時に設定されます。
データベースサーバは同じデフォルト値を使用するので、多くの場合、ポートは指定する必要はありません。
デフォルトのユーザ名とデータベース名は、OSのユーザ名です。
任意のユーザ名で全てのデータベースに接続できるわけではありません。
データベース管理者は、接続権限をユーザに知らせておかなければなりません。
</p><p><span class="original">
When the defaults aren't quite right, you can save yourself
some typing by setting the environment variables
<envar>PGDATABASE</envar>, <envar>PGHOST</envar>,
<envar>PGPORT</envar> and/or <envar>PGUSER</envar> to appropriate
values. (For additional environment variables, see <xref
linkend="libpq-envars">.) It is also convenient to have a
<filename>~/.pgpass</> file to avoid regularly having to type in
passwords. See <xref linkend="libpq-pgpass"> for more information.
</span>デフォルトが完全には適用できない時は、入力の手間を省くために、環境変数<code class="envar">PGDATABASE</code>、<code class="envar">PGHOST</code>、<code class="envar">PGPORT</code>、<code class="envar">PGUSER</code>に適当な値を設定することもできます。
(この他の環境変数については、<a class="xref" href="libpq-envars.html" title="31.14. 環境変数">31.14. 環境変数</a>を参照してください。)
また、<code class="filename">~/.pgpass</code>ファイルを使用すれば、定常的なパスワードの入力を省略でき、便利です。
詳細は<a class="xref" href="libpq-pgpass.html" title="31.15. パスワードファイル">31.15. パスワードファイル</a>を参照してください。
</p><p><span class="original">
An alternative way to specify connection parameters is in a
<parameter>conninfo</parameter> string or
a <acronym>URI</acronym>, which is used instead of a database
name. This mechanism give you very wide control over the
connection. For example:
</span>他の接続パラメータの指定方法として<em class="parameter"><code>conninfo</code></em>文字列または<acronym class="acronym">URI</acronym>があります。
これは、データベース名の代わりに使用されます。
この機構により、接続全体に関する非常に幅広い制御を行うことができます。
以下に例を示します。
</p><pre class="programlisting">$ <strong class="userinput"><code>psql "service=myservice sslmode=require"</code></strong>
$ <strong class="userinput"><code>psql postgresql://dbmaster:5433/mydb?sslmode=require</code></strong></pre><p><span class="original">
This way you can also use <acronym>LDAP</acronym> for connection
parameter lookup as described in <xref linkend="libpq-ldap">.
See <xref linkend="libpq-paramkeywords"> for more information on all the
available connection options.
</span>
この方法では接続パラメータの検索に、<a class="xref" href="libpq-ldap.html" title="31.17. 接続パラメータのLDAP検索">31.17. 接続パラメータのLDAP検索</a>で説明する<acronym class="acronym">LDAP</acronym>を使用することもできます。
利用できる接続オプションのすべてについての詳細は、<a class="xref" href="libpq-connect.html#libpq-paramkeywords" title="31.1.2. パラメータキーワード">31.1.2. パラメータキーワード</a>を参照してください。
</p><p><span class="original">
If the connection could not be made for any reason (e.g., insufficient
privileges, server is not running on the targeted host, etc.),
<application>psql</application> will return an error and terminate.
</span>何らかの原因(権限がない、指定したホストでサーバが稼働していないなど)で接続ができなかった場合は、<span class="application">psql</span>はエラーメッセージを表示し、終了します。
</p><p><span class="original">
If both standard input and standard output are a
terminal, then <application>psql</application> sets the client
encoding to <quote>auto</quote>, which will detect the
appropriate client encoding from the locale settings
(<envar>LC_CTYPE</envar> environment variable on Unix systems).
If this doesn't work out as expected, the client encoding can be
overridden using the environment
variable <envar>PGCLIENTENCODING</envar>.
</span>標準入力および標準出力の両方が端末である場合、<span class="application">psql</span>はクライアントの符号化方式を<span class="quote">「<span class="quote">auto</span>」</span>に設定します。
これはロケール設定(Unixシステムでは環境変数<code class="envar">LC_CTYPE</code>)から適切なクライアント符号化方式を決定します。
想定した通りに動作しない場合、環境変数<code class="envar">PGCLIENTENCODING</code>を使用してクライアント符号化方式を上書きすることができます。
</p></div><div class="refsect2" id="r2-app-psql-4"><h3>SQLコマンドの入力</h3><span class="original">
<title>Entering SQL Commands</title>
</span><p><span class="original">
In normal operation, <application>psql</application> provides a
prompt with the name of the database to which
<application>psql</application> is currently connected, followed by
the string <literal>=&gt;</literal>. For example:
</span>通常の操作において、<span class="application">psql</span>は、<span class="application">psql</span>が現在接続しているデータベース名の後に<code class="literal">=></code>の文字列が付いたプロンプトを表示します。
以下に例を示します。
</p><pre class="programlisting">$ <strong class="userinput"><code>psql testdb</code></strong>
psql (9.5.4)
Type "help" for help.
testdb=></pre><p>
</p><p><span class="original">
At the prompt, the user can type in <acronym>SQL</acronym> commands.
Ordinarily, input lines are sent to the server when a
command-terminating semicolon is reached. An end of line does not
terminate a command. Thus commands can be spread over several lines for
clarity. If the command was sent and executed without error, the results
of the command are displayed on the screen.
</span>プロンプトに対しユーザは<acronym class="acronym">SQL</acronym>コマンドを入力することができます。
通常、入力された行はコマンド終了を意味するセミコロンに達した時点でサーバへと送信されます。
改行はコマンドの終了とはみなされません。
したがって、わかりやすくするために、コマンドは複数の行にわたって記述することができます。
コマンドが送信され問題なく実行されると、画面にコマンドの結果が表示されます。
</p><p><span class="original">
Whenever a command is executed, <application>psql</application> also polls
for asynchronous notification events generated by
<xref linkend="SQL-LISTEN"> and
<xref linkend="SQL-NOTIFY">.
</span>また、コマンドが実行される度に、<span class="application">psql</span>は<a class="xref" href="sql-listen.html" title="LISTEN"><span class="refentrytitle">LISTEN</span></a>と<a class="xref" href="sql-notify.html" title="NOTIFY"><span class="refentrytitle">NOTIFY</span></a>によって生成された非同期通知イベントを検査します。
</p><p><span class="original">
While C-style block comments are passed to the server for
processing and removal, SQL-standard comments are removed by
<application>psql</application>.
</span>Cの形式のブロックコメントは、サーバに送信され、サーバによって取り除かれますが、SQL標準のコメントは<span class="application">psql</span>によって取り除かれます。
</p></div><div class="refsect2" id="app-psql-meta-commands"><h3>メタコマンド</h3><span class="original">
<title>Meta-Commands</title>
</span><p><span class="original">
Anything you enter in <application>psql</application> that begins
with an unquoted backslash is a <application>psql</application>
meta-command that is processed by <application>psql</application>
itself. These commands make
<application>psql</application> more useful for administration or
scripting. Meta-commands are often called slash or backslash commands.
</span><span class="application">psql</span>内で入力されたコマンドのうち、引用符で囲まれていないバックスラッシュで始まるものは、<span class="application">psql</span>自身が実行する<span class="application">psql</span>のメタコマンドとして扱われます。
これらのコマンドを使うと、データベースを管理したりスクリプトを作成するにあたって、<span class="application">psql</span>がより便利になります。
メタコマンドはよくスラッシュコマンド、またはバックスラッシュコマンドとも呼ばれます。
</p><p><span class="original">
The format of a <application>psql</application> command is the backslash,
followed immediately by a command verb, then any arguments. The arguments
are separated from the command verb and each other by any number of
whitespace characters.
</span><span class="application">psql</span>コマンドは、バックスラッシュ、コマンド本体、引数の順につなげた形式になっています。
引数とコマンド本体の間および引数と引数の間は、空白文字によって分割されています。
</p><p><span class="original">
To include whitespace in an argument you can quote it with
single quotes. To include a single quote in an argument,
write two single quotes within single-quoted text.
Anything contained in single quotes is
furthermore subject to C-like substitutions for
<literal>\n</literal> (new line), <literal>\t</literal> (tab),
<literal>\b</literal> (backspace), <literal>\r</literal> (carriage return),
<literal>\f</literal> (form feed),
<literal>\</literal><replaceable>digits</replaceable> (octal), and
<literal>\x</literal><replaceable>digits</replaceable> (hexadecimal).
A backslash preceding any other character within single-quoted text
quotes that single character, whatever it is.
</span>引数に空白を含める場合は単一引用符で囲みます。
単一引用符を引数に含める場合には、単一引用符で括られた文字列の中で、その単一引用符を2つ続けてください。
単一引用符で囲われた文字は、C言語と同じような置換の対象となります。
このような文字には、<code class="literal">\n</code>(改行)、<code class="literal">\t</code>(タブ)、<code class="literal">\b</code> (後退)、<code class="literal">\r</code>(復帰)、<code class="literal">\f</code> (改頁)、<code class="literal">\</code><em class="replaceable"><code>digits</code></em>(8進数で表された文字)、<code class="literal">\x</code><em class="replaceable"><code>digits</code></em>(16進数で表された文字)があります。
単一引用符で括られたテキスト内でその他の任意の文字の前にバックスラッシュを付けた場合は、その文字が何であろうとその一文字だけとして扱われます。
</p><p><span class="original">
Within an argument, text that is enclosed in backquotes
(<literal>`</literal>) is taken as a command line that is passed to the
shell. The output of the command (with any trailing newline removed)
replaces the backquoted text.
</span>引数の中で逆引用符(<code class="literal">`</code>)で囲まれたテキストは、コマンドラインとして認識され、シェルに渡されます。
コマンドの結果(末尾の改行は削除されます)で逆引用符で囲まれたテキストを置き換えます。
</p><p><span class="original">
If an unquoted colon (<literal>:</literal>) followed by a
<application>psql</> variable name appears within an argument, it is
replaced by the variable's value, as described in <xref
linkend="APP-PSQL-interpolation" endterm="APP-PSQL-interpolation-title">.
</span><a class="xref" href="app-psql.html#app-psql-interpolation" title="SQL差し替え"><acronym class="acronym">SQL</acronym>差し替え</a>に示すように、引数の中で引用符で囲まれていないコロン(<code class="literal">:</code>)の後に<span class="application">psql</span>変数名が存在する場合、そこは変数の値に置換されます。
</p><p><span class="original">
Some commands take an <acronym>SQL</acronym> identifier (such as a
table name) as argument. These arguments follow the syntax rules
of <acronym>SQL</acronym>: Unquoted letters are forced to
lowercase, while double quotes (<literal>"</>) protect letters
from case conversion and allow incorporation of whitespace into
the identifier. Within double quotes, paired double quotes reduce
to a single double quote in the resulting name. For example,
<literal>FOO"BAR"BAZ</> is interpreted as <literal>fooBARbaz</>,
and <literal>"A weird"" name"</> becomes <literal>A weird"
name</>.
</span>コマンドには、引数として(テーブル名などの)<acronym class="acronym">SQL</acronym>の識別子を取るものがあります。
これらの引数は次のような<acronym class="acronym">SQL</acronym>の構文規則に従います。
引用符を伴わない文字は強制的に小文字になります。しかし、二重引用符(<code class="literal">"</code>)で囲まれると、大文字小文字変換が行われず、空白文字を識別子内に含めることができます。
さらに、二重引用符内では、連続する2つの二重引用符は1つの二重引用符とみなされます。
例えば、<code class="literal">FOO"BAR"BAZ</code>は<code class="literal">fooBARbaz</code>と解釈され、<code class="literal">"A weird"" name"</code>は<code class="literal">A weird" name</code>になります。
</p><p><span class="original">
Parsing for arguments stops at the end of the line, or when another
unquoted backslash is found. An unquoted backslash
is taken as the beginning of a new meta-command. The special
sequence <literal>\\</literal> (two backslashes) marks the end of
arguments and continues parsing <acronym>SQL</acronym> commands, if
any. That way <acronym>SQL</acronym> and
<application>psql</application> commands can be freely mixed on a
line. But in any case, the arguments of a meta-command cannot
continue beyond the end of the line.
</span>引数の解析は行末または引用符で囲まれていないもう1つのバックスラッシュが見つかると終了します。
引用符がないバックスラッシュは新しいメタコマンドの始まりと解釈されます。
<code class="literal">\\</code>(バックスラッシュ2つ)という特別な文字の並びは引数の終わりを意味するので、<acronym class="acronym">SQL</acronym>コマンドが残されている場合は、その解析を続けます。
このように、<acronym class="acronym">SQL</acronym>コマンドと<span class="application">psql</span>コマンドは1つの行に自由に混合して記述することができます。
しかし、あらゆる場合において、メタコマンドの引数は行をまたぐことはできません。
</p><p><span class="original">
The following meta-commands are defined:
</span>メタコマンドとして、以下のものが定義されています。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">\a</code></span></dt><dd><p><span class="original">
If the current table output format is unaligned, it is switched to aligned.
If it is not unaligned, it is set to unaligned. This command is
kept for backwards compatibility. See <command>\pset</command> for a
more general solution.
</span>現在のテーブルの出力形式が「揃えない」になっていれば「揃える」に、
「揃える」になっていれば「揃えない」に設定します。
このコマンドは後方互換性を保持するためにあります。
より一般的な解決策は<code class="command">\pset</code>を参照してください。
</p></dd><dt><span class="term"><code class="literal">\c</code> または <code class="literal">\connect [ -reuse-previous=<em class="replaceable"><code>on|off</code></em> ] [ <em class="replaceable"><code>dbname</code></em> [ <em class="replaceable"><code>username</code></em> ] [ <em class="replaceable"><code>host</code></em> ] [ <em class="replaceable"><code>port</code></em> ] | <em class="replaceable"><code>conninfo</code></em> ]</code></span></dt><dd><p><span class="original">
Establishes a new connection to a <productname>PostgreSQL</>
server. The connection parameters to use can be specified either
using a positional syntax, or using <literal>conninfo</> connection
strings as detailed in <xref linkend="libpq-connstring">.
</span><span class="productname">PostgreSQL</span>サーバへの新規の接続を確立します。
接続のパラメータは、位置の構文、あるいは<code class="literal">conninfo</code>接続文字列で指定することができます。
後者の詳細は<a class="xref" href="libpq-connect.html#libpq-connstring" title="31.1.1. 接続文字列">31.1.1. 接続文字列</a>で説明します。
</p><p><span class="original">
Where the command omits database name, user, host, or port, the new
connection can reuse values from the previous connection. By default,
values from the previous connection are reused except when processing
a <literal>conninfo</> string. Passing a first argument
of <literal>-reuse-previous=on</>
or <literal>-reuse-previous=off</literal> overrides that default.
When the command neither specifies nor reuses a particular parameter,
the <application>libpq</application> default is used. Specifying any
of <replaceable class="parameter">dbname</replaceable>,
<replaceable class="parameter">username</replaceable>,
<replaceable class="parameter">host</replaceable> or
<replaceable class="parameter">port</replaceable>
as <literal>-</literal> is equivalent to omitting that parameter.
</span>コマンドでデータベース名、ユーザ、ホストあるいはポートを省略した場合、新しい接続では以前の接続での値を再利用することができます。
デフォルトでは、<code class="literal">conninfo</code>文字列を処理する場合を除き、以前の接続での値が再利用されます。
第一引数で<code class="literal">-reuse-previous=on</code>あるいは<code class="literal">-reuse-previous=off</code>を渡すことで、このデフォルトと異なる動作をさせることができます。
コマンドで特定のパラメータを指定せず、かつ再利用もしない場合は、<span class="application">libpq</span>のデフォルトが使用されます。
<em class="replaceable"><code>dbname</code></em>、<em class="replaceable"><code>username</code></em>、<em class="replaceable"><code>host</code></em>、<em class="replaceable"><code>port</code></em>のいずれについても<code class="literal">-</code>を指定するのは、パラメータを省略するのと同じになります。
</p><p><span class="original">
If the new connection is successfully made, the previous
connection is closed.
If the connection attempt failed (wrong user name, access
denied, etc.), the previous connection will only be kept if
<application>psql</application> is in interactive mode. When
executing a non-interactive script, processing will
immediately stop with an error. This distinction was chosen as
a user convenience against typos on the one hand, and a safety
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</span>新規接続に成功した場合、以前の接続は閉じられます。
接続の試行が(ユーザ名の間違いやアクセス拒否などの理由で)失敗した場合、<span class="application">psql</span>が対話式モードである場合に限り、それまでの接続が保持されます。
非対話式スクリプトを実行している場合は、処理はエラーとなり、即座に停止します。
この実装の違いは、対話モードでは入力ミスに対するユーザの利便性を考慮し、非対話モードではスクリプトによって間違ったデータベースを操作することを防ぐための安全策を考慮した結果決められました。
</p><p><span class="original">
Examples:
</span>例:
</p><pre class="programlisting">=> \c mydb myuser host.dom 6432
=> \c service=foo
=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
=> \c postgresql://tom@localhost/mydb?application_name=myapp</pre></dd><dt><span class="term"><code class="literal">\C [ <em class="replaceable"><code>title</code></em> ]</code></span></dt><dd><p><span class="original">
Sets the title of any tables being printed as the result of a
query or unset any such title. This command is equivalent to
<literal>\pset title <replaceable
class="parameter">title</replaceable></literal>. (The name of
this command derives from <quote>caption</quote>, as it was
previously only used to set the caption in an
<acronym>HTML</acronym> table.)
</span>問い合わせ結果として表示されるテーブルのタイトルの設定、または、タイトルの設定解除を行います。
このコマンドは、<code class="literal">\pset title <em class="replaceable"><code>title</code></em></code>と同じ効力を持ちます。
(このコマンド名は<span class="quote">「<span class="quote">標題(caption)</span>」</span>に由来します。
以前は<acronym class="acronym">HTML</acronym>のテーブルの標題を設定するためだけに使われていたためです。)
</p></dd><dt><span class="term"><code class="literal">\cd [ <em class="replaceable"><code>directory</code></em> ]</code></span></dt><dd><p><span class="original">
Changes the current working directory to
<replaceable>directory</replaceable>. Without argument, changes
to the current user's home directory.
</span>現在の作業ディレクトリを<em class="replaceable"><code>directory</code></em>に変更します。
引数がない場合は、現在のユーザのホームディレクトリに変更します。
</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">ヒント</h3><p><span class="original">
To print your current working directory, use <literal>\! pwd</literal>.
</span>現在の作業ディレクトリを表示するには、<code class="literal">\! pwd</code>を使用してください。
</p></div></dd><dt><span class="term"><code class="literal">\conninfo</code></span></dt><dd><p><span class="original">
Outputs information about the current database connection.
</span>現在のデータベース接続に関する情報を出力します。
</p></dd><dt id="app-psql-meta-commands-copy"><span class="term"><code class="literal">\copy { <em class="replaceable"><code>table</code></em> [ ( <em class="replaceable"><code>column_list</code></em> ) ] | ( <em class="replaceable"><code>query</code></em> ) }
{ <code class="literal">from</code> | <code class="literal">to</code> }
{ <em class="replaceable"><code>'filename'</code></em> | program <em class="replaceable"><code>'command'</code></em> | stdin | stdout | pstdin | pstdout }
[ [ with ] ( <em class="replaceable"><code>option</code></em> [, ...] ) ]</code></span></dt><dd><p><span class="original">
Performs a frontend (client) copy. This is an operation that
runs an <acronym>SQL</acronym> <xref linkend="SQL-COPY">
command, but instead of the server
reading or writing the specified file,
<application>psql</application> reads or writes the file and
routes the data between the server and the local file system.
This means that file accessibility and privileges are those of
the local user, not the server, and no SQL superuser
privileges are required.
</span>フロントエンド(クライアント)コピーを行います。
これは<a class="xref" href="sql-copy.html" title="COPY"><span class="refentrytitle">COPY</span></a> <acronym class="acronym">SQL</acronym>コマンドを実行する操作ですが、サーバで指定ファイルに対する読み込みまたは書き込みを行うのではなく、<span class="application">psql</span>がファイルの読み書きや、サーバとローカルファイルシステム間のデータ送信を行います。
この場合、ファイルへのアクセス権限はサーバではなくローカルユーザのものを使用するので、SQLのスーパーユーザ権限は必要ありません。
</p><p><span class="original">
When <literal>program</> is specified,
<replaceable class="parameter">command</replaceable> is
executed by <application>psql</application> and the data passed from
or to <replaceable class="parameter">command</replaceable> is
routed between the server and the client.
Again, the execution privileges are those of
the local user, not the server, and no SQL superuser
privileges are required.
</span><code class="literal">program</code>が指定された場合、<em class="replaceable"><code>command</code></em>が<span class="application">psql</span>により実行され、<em class="replaceable"><code>command</code></em>から、または、<em class="replaceable"><code>command</code></em>へのデータはサーバとクライアント間を行き来します。
ここでも、実行権限はローカル側のユーザであり、サーバ側ではなく、SQLスーパーユーザ権限は必要とされません。
</p><p><span class="original">
For <literal>\copy ... from stdin</>, data rows are read from the same
source that issued the command, continuing until <literal>\.</literal>
is read or the stream reaches <acronym>EOF</>. This option is useful
for populating tables in-line within a SQL script file.
For <literal>\copy ... to stdout</>, output is sent to the same place
as <application>psql</> command output, and
the <literal>COPY <replaceable>count</></literal> command status is
not printed (since it might be confused with a data row).
To read/write <application>psql</application>'s standard input or
output regardless of the current command source or <literal>\o</>
option, write <literal>from pstdin</> or <literal>to pstdout</>.
</span><code class="literal">\copy ... from stdin</code>では、データ行は、コマンドの発行源と同じところから、<code class="literal">\.</code>を読み取るまで、あるいは、ストリームが<acronym class="acronym">EOF</acronym>に達するまで読み続けます。
このオプションは、SQLスクリプトファイルの内部でテーブルにデータを投入する場合に便利です。
<code class="literal">\copy ... to stdout</code>では、出力は<span class="application">psql</span>コマンドの出力と同じところに送られますが、<code class="literal">COPY <em class="replaceable"><code>count</code></em></code>コマンドのステータスは表示されません(これはデータ行と混同してしまうかもしれないからです)。
コマンドの入力元や<code class="literal">\o</code>オプションに関わらず、<span class="application">psql</span>の標準入力や標準出力を読み書きするには、<code class="literal">from pstdin</code>あるいは<code class="literal">to pstdout</code>と書いてください。
</p><p><span class="original">
The syntax of this command is similar to that of the
<acronym>SQL</acronym> <xref linkend="sql-copy">
command. All options other than the data source/destination are
as specified for <xref linkend="sql-copy">.
Because of this, special parsing rules apply to the <command>\copy</>
command. In particular, <application>psql</>'s variable substitution
rules and backslash escapes do not apply.
</span>このコマンドの構文は<acronym class="acronym">SQL</acronym>の<a class="xref" href="sql-copy.html" title="COPY"><span class="refentrytitle">COPY</span></a>コマンドに似ています。
データの入力元と出力先以外のすべてのオプションは<a class="xref" href="sql-copy.html" title="COPY"><span class="refentrytitle">COPY</span></a>と同じです。
このため<code class="command">\copy</code>コマンドには特別な解析規則が適用されていることに注意してください。
特に、<span class="application">psql</span>の変数の置換規則やバックスラッシュエスケープは適用されません。
</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">ヒント</h3><p><span class="original">
This operation is not as efficient as the <acronym>SQL</acronym>
<command>COPY</command> command because all data must pass
through the client/server connection. For large
amounts of data the <acronym>SQL</acronym> command might be preferable.
</span>この操作は<acronym class="acronym">SQL</acronym>の<code class="command">COPY</code>コマンドほど効率が良いわけではありません。
これは、全てのデータをクライアント/サーバ接続を通じてやり取りしなければならないからです。
データ量が多い時は<acronym class="acronym">SQL</acronym>コマンドを使用する方が良いでしょう。
</p></div></dd><dt><span class="term"><code class="literal">\copyright</code></span></dt><dd><p><span class="original">
Shows the copyright and distribution terms of
<productname>PostgreSQL</productname>.
</span><span class="productname">PostgreSQL</span>の著作権および配布条項を表示します。
</p></dd><dt><span class="term"><code class="literal">\d[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
For each relation (table, view, index, sequence, or foreign table)
or composite type matching the
<replaceable class="parameter">pattern</replaceable>, show all
columns, their types, the tablespace (if not the default) and any
special attributes such as <literal>NOT NULL</literal> or defaults.
Associated indexes, constraints, rules, and triggers are
also shown. For foreign tables, the associated foreign
server is shown as well.
(<quote>Matching the pattern</> is defined in
<xref linkend="APP-PSQL-patterns" endterm="APP-PSQL-patterns-title">
below.)
</span><em class="replaceable"><code>pattern</code></em>にマッチする各リレーション(テーブル、ビュー、インデックス、シーケンス、外部テーブル)または複合型について、全ての列、列の型、テーブル空間(デフォルト以外を使用している場合)、<code class="literal">NOT NULL</code>やデフォルトなどの特別な属性を表示します。
関連付けられているインデックス、制約、ルールおよびトリガも表示されます。
外部テーブルでは関連する外部サーバも表示されます。
(<span class="quote">「<span class="quote">パターンのマッチング</span>」</span>については後述の<a class="xref" href="app-psql.html#app-psql-patterns" title="パターン">パターン</a>で定義されています。)
</p><p><span class="original">
For some types of relation, <literal>\d</> shows additional information
for each column: column values for sequences, indexed expression for
indexes and foreign data wrapper options for foreign tables.
</span>一部の種類のリレーションでは、<code class="literal">\d</code>は各列について追加の情報を表示します。
例えば、シーケンスでは列の値、インデックスではインデックス式、外部テーブルでは外部データラッパのオプションです。
</p><p><span class="original">
The command form <literal>\d+</literal> is identical, except that
more information is displayed: any comments associated with the
columns of the table are shown, as is the presence of OIDs in the
table, the view definition if the relation is a view, a non-default
<link linkend="SQL-CREATETABLE-REPLICA-IDENTITY">replica
identity</link> setting.
</span><code class="literal">\d+</code>というコマンド形式も同一ですが、より多くの情報を表示します。
こちらでは、テーブルの列に関連付けられたコメントやテーブルにOIDが存在するかどうか、リレーションがビューの場合はビューの定義、デフォルトと異なる<a class="link" href="sql-altertable.html#sql-createtable-replica-identity">replica identity</a>の設定も表示されます。
</p><p><span class="original">
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
</span>デフォルトではユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためには、パターンまたは<code class="literal">S</code>修飾子を付与してください。
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">注記</h3><p><span class="original">
If <command>\d</command> is used without a
<replaceable class="parameter">pattern</replaceable> argument, it is
equivalent to <command>\dtvsE</command> which will show a list of
all visible tables, views, sequences and foreign tables.
This is purely a convenience measure.
</span><code class="command">\d</code>が<em class="replaceable"><code>pattern</code></em>引数なしで使用された場合は、<code class="command">\dtvsE</code>と同じ意味となり、可視である全てのテーブル、ビュー、シーケンス、外部テーブルの一覧が表示されます。
これは単に便宜上のものです。
</p></div></dd><dt><span class="term"><code class="literal">\da[S] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists aggregate functions, together with their
return type and the data types they operate on. If <replaceable
class="parameter">pattern</replaceable>
is specified, only aggregates whose names match the pattern are shown.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
</span>集約関数と、その戻り値のデータ型、演算対象となるデータ型の一覧を表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、そのパターンに名前がマッチする集約のみが表示されます。
デフォルトではユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためには、パターンまたは<code class="literal">S</code>修飾子を付与してください。
</p></dd><dt><span class="term"><code class="literal">\db[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists tablespaces. If <replaceable
class="parameter">pattern</replaceable>
is specified, only tablespaces whose names match the pattern are shown.
If <literal>+</literal> is appended to the command name, each tablespace
is listed with its associated options, on-disk size, permissions and
description.
</span>テーブル空間を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、そのパターンに名前がマッチするテーブル空間のみが表示されます。
コマンド名に<code class="literal">+</code>が付与された場合、各テーブル空間に関連付けされたオプション、ディスク上のサイズ、権限、摘要についても表示します。
</p></dd><dt><span class="term"><code class="literal">\dc[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists conversions between character-set encodings.
If <replaceable class="parameter">pattern</replaceable>
is specified, only conversions whose names match the pattern are
listed.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
If <literal>+</literal> is appended to the command name, each object
is listed with its associated description.
</span>文字セット符号化方式間の変換の一覧を表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、そのパターンに名前がマッチする変換のみが表示されます。
デフォルトではユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためには、パターンまたは<code class="literal">S</code>修飾子を付与してください。
コマンド名に<code class="literal">+</code>を付与すると、各オブジェクトに関連する説明を付けて表示します。
</p></dd><dt><span class="term"><code class="literal">\dC[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists type casts.
If <replaceable class="parameter">pattern</replaceable>
is specified, only casts whose source or target types match the
pattern are listed.
If <literal>+</literal> is appended to the command name, each object
is listed with its associated description.
</span>型キャストの一覧を表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、そのパターンに元データ型または変換先データ型がマッチするキャストのみが表示されます。
コマンド名に<code class="literal">+</code>を付与すると、各オブジェクトに関連する説明を付けて表示します。
</p></dd><dt><span class="term"><code class="literal">\dd[S] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Shows the descriptions of objects of type <literal>constraint</>,
<literal>operator class</>, <literal>operator family</>,
<literal>rule</>, and <literal>trigger</>. All
other comments may be viewed by the respective backslash commands for
those object types.
</span><code class="literal">constraint</code>、<code class="literal">operator class</code>、<code class="literal">operator family</code>、<code class="literal">rule</code>、<code class="literal">trigger</code>という種類のオブジェクトについての説明を表示します。
他のコメントはすべて、これらのオブジェクト種類用の対応するバックスラッシュコマンドによって表示されます。
</p><span class="original">
<para><literal>\dd</literal> displays descriptions for objects matching the
<replaceable class="parameter">pattern</replaceable>, or of visible
objects of the appropriate type if no argument is given. But in either
case, only objects that have a description are listed.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
</span><p><code class="literal">\dd</code>は<em class="replaceable"><code>pattern</code></em>にマッチするオブジェクトの説明を表示します。
引数が指定されていない場合は、適切な種類の可視なオブジェクトの説明を表示します。
どちらの場合でも、一覧に表示されるのは説明を持つオブジェクトのみです
デフォルトではユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためには、パターンまたは<code class="literal">S</code>修飾子を付与してください。
</p><p><span class="original">
Descriptions for objects can be created with the <xref
linkend="sql-comment">
<acronym>SQL</acronym> command.
</span>オブジェクトの説明は<a class="xref" href="sql-comment.html" title="COMMENT"><span class="refentrytitle">COMMENT</span></a> <acronym class="acronym">SQL</acronym>コマンドを使用して作成することができます。
</p></dd><dt><span class="term"><code class="literal">\ddp [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists default access privilege settings. An entry is shown for
each role (and schema, if applicable) for which the default
privilege settings have been changed from the built-in defaults.
If <replaceable class="parameter">pattern</replaceable> is
specified, only entries whose role name or schema name matches
the pattern are listed.
</span>デフォルトのアクセス権限設定を一覧表示します。
組み込みのデフォルトから権限設定が変更されたロール(および適切ならばスキーマも)ごとに1項目示されます。
<em class="replaceable"><code>pattern</code></em>が指定された場合、パターンにマッチするロール名またはスキーマ名の項目のみが表示されます。
</p><p><span class="original">
The <xref linkend="sql-alterdefaultprivileges"> command is used to set
default access privileges. The meaning of the
privilege display is explained under
<xref linkend="sql-grant">.
</span><a class="xref" href="sql-alterdefaultprivileges.html" title="ALTER DEFAULT PRIVILEGES"><span class="refentrytitle">ALTER DEFAULT PRIVILEGES</span></a>コマンドを使用して、デフォルトのアクセス権限を設定します。
権限表示の意味は<a class="xref" href="sql-grant.html" title="GRANT"><span class="refentrytitle">GRANT</span></a>で説明します。
</p></dd><dt><span class="term"><code class="literal">\dD[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists domains. If <replaceable
class="parameter">pattern</replaceable>
is specified, only domains whose names match the pattern are shown.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
If <literal>+</literal> is appended to the command name, each object
is listed with its associated permissions and description.
</span>ドメインを一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定されている場合は、パターンに名前がマッチするドメインのみが表示されます。
デフォルトではユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためには、パターンまたは<code class="literal">S</code>修飾子を付与してください。
コマンド名に<code class="literal">+</code>を付与すると、各オブジェクトに関連する権限と説明を付けて表示します。
</p></dd><dt><span class="term"><code class="literal">\dE[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code><br /></span><span class="term"><code class="literal">\di[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code><br /></span><span class="term"><code class="literal">\dm[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code><br /></span><span class="term"><code class="literal">\ds[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code><br /></span><span class="term"><code class="literal">\dt[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code><br /></span><span class="term"><code class="literal">\dv[S+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
In this group of commands, the letters <literal>E</literal>,
<literal>i</literal>, <literal>m</literal>, <literal>s</literal>,
<literal>t</literal>, and <literal>v</literal>
stand for foreign table, index, materialized view, sequence, table, and view,
respectively.
You can specify any or all of
these letters, in any order, to obtain a listing of objects
of these types. For example, <literal>\dit</> lists indexes
and tables. If <literal>+</literal> is
appended to the command name, each object is listed with its
physical size on disk and its associated description, if any.
If <replaceable class="parameter">pattern</replaceable> is
specified, only objects whose names match the pattern are listed.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
</span>このコマンド群において、<code class="literal">E</code>、<code class="literal">i</code>、<code class="literal">m</code>、<code class="literal">s</code>、<code class="literal">t</code>、<code class="literal">v</code>という文字はそれぞれ、外部テーブル、インデックス、マテリアライズドビュー、シーケンス、テーブル、ビューを表します。
これらの種類のオブジェクトの一覧を表示するために、これらの文字の中の任意の文字またはすべてを任意の順番で指定することができます。
例えば、<code class="literal">\dit</code>はインデックスとテーブルを列挙します。
<code class="literal">+</code>がコマンド名に付与された場合、各オブジェクトは、もしあればディスク上の物理容量と関連する説明をつけて表示されます。
<em class="replaceable"><code>pattern</code></em>が指定されている場合は、パターンに名称がマッチする項目のみが表示されます。
デフォルトでは、ユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためにはパターンまたは<code class="literal">S</code>修飾子を付与してください。
</p></dd><dt><span class="term"><code class="literal">\des[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists foreign servers (mnemonic: <quote>external
servers</quote>).
If <replaceable class="parameter">pattern</replaceable> is
specified, only those servers whose name matches the pattern
are listed. If the form <literal>\des+</literal> is used, a
full description of each server is shown, including the
server's ACL, type, version, options, and description.
</span>外部(foreign)サーバ(つまり<span class="quote">「<span class="quote">external servers</span>」</span>)を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定されている場合は、名前がパターンにマッチするサーバのみが表示されます。
<code class="literal">\des+</code>構文が使用された場合、サーバのACL、型、バージョン、オプション、説明など各サーバの完全な説明が表示されます。
</p></dd><dt><span class="term"><code class="literal">\det[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists foreign tables (mnemonic: <quote>external tables</quote>).
If <replaceable class="parameter">pattern</replaceable> is
specified, only entries whose table name or schema name matches
the pattern are listed. If the form <literal>\det+</literal>
is used, generic options and the foreign table description
are also displayed.
</span>外部(foreign)テーブル(つまり<span class="quote">「<span class="quote">external tables</span>」</span>)を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、パターンにテーブル名またはスキーマ名がマッチするもののみが表示されます。
<code class="literal">\det+</code>が使用された場合、汎用オプションと外部テーブルの説明も表示されます。
</p></dd><dt><span class="term"><code class="literal">\deu[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists user mappings (mnemonic: <quote>external
users</quote>).
If <replaceable class="parameter">pattern</replaceable> is
specified, only those mappings whose user names match the
pattern are listed. If the form <literal>\deu+</literal> is
used, additional information about each mapping is shown.
</span>ユーザマップ(つまり<span class="quote">「<span class="quote">external users</span>」</span>)を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定されている場合は、名前がパターンにマッチするユーザのみが表示されます。
<code class="literal">\deu+</code>構文が使用された場合、各マップについて追加情報が表示されます。
</p><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">注意</h3><p><span class="original">
<literal>\deu+</literal> might also display the user name and
password of the remote user, so care should be taken not to
disclose them.
</span><code class="literal">\deu+</code>ではリモートユーザのユーザ名とパスワードも表示される可能性があります。
これらを外部に曝さないように注意しなければなりません。
</p></div></dd><dt><span class="term"><code class="literal">\dew[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists foreign-data wrappers (mnemonic: <quote>external
wrappers</quote>).
If <replaceable class="parameter">pattern</replaceable> is
specified, only those foreign-data wrappers whose name matches
the pattern are listed. If the form <literal>\dew+</literal>
is used, the ACL, options, and description of the foreign-data
wrapper are also shown.
</span>外部データラッパ(つまり<span class="quote">「<span class="quote">external wrappers</span>」</span>)を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定されている場合、名前がパターンにマッチする外部データラッパのみが表示されます。
<code class="literal">\dew+</code>構文が使用された場合、外部データラッパのACL、オプションおよび説明も表示されます。
</p></dd><dt><span class="term"><code class="literal">\df[antwS+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists functions, together with their arguments, return types, and
function types, which are classified as <quote>agg</> (aggregate),
<quote>normal</>, <quote>trigger</>, or <quote>window</>.
To display only functions
of specific type(s), add the corresponding letters <literal>a</>,
<literal>n</>, <literal>t</>, or <literal>w</> to the command.
If <replaceable
class="parameter">pattern</replaceable> is specified, only
functions whose names match the pattern are shown.
By default, only user-created
objects are shown; supply a pattern or the <literal>S</literal>
modifier to include system objects.
If the form <literal>\df+</literal> is used, additional information
about each function is shown, including security classification,
volatility, owner, language, source code and description.
</span>関数とその引数と戻り値の型、および、<span class="quote">「<span class="quote">agg</span>」</span> (集約)、<span class="quote">「<span class="quote">normal</span>」</span>、<span class="quote">「<span class="quote">trigger</span>」</span>、<span class="quote">「<span class="quote">window</span>」</span>で分類される関数の種類の一覧を表示します。
特定種類の関数のみを表示させるには、対応する文字<code class="literal">a</code>、<code class="literal">n</code>、<code class="literal">t</code>、<code class="literal">w</code>をコマンドに付けて下さい。
<em class="replaceable"><code>pattern</code></em>が指定されている場合は、そのパターンに名前がマッチする関数のみが表示されます。
デフォルトではユーザが作成したオブジェクトのみが表示されます。
システムオブジェクトを含めるためには、パターンまたは<code class="literal">S</code>修飾子を付与してください。
<code class="literal">\df+</code>構文が使われた場合、各関数の、セキュリティ分類、揮発性、所有者、言語、ソースコードや説明を含む付加的情報も表示されます。
</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">ヒント</h3><p><span class="original">
To look up functions taking arguments or returning values of a specific
type, use your pager's search capability to scroll through the
<literal>\df</> output.
</span>特定の型を引数とする関数や特定の型を返す関数を検索するには、ページャの検索機能を使用して<code class="literal">\df</code>の出力をスクロールしてください。
</p></div></dd><dt><span class="term"><code class="literal">\dF[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists text search configurations.
If <replaceable class="parameter">pattern</replaceable> is specified,
only configurations whose names match the pattern are shown.
If the form <literal>\dF+</literal> is used, a full description of
each configuration is shown, including the underlying text search
parser and the dictionary list for each parser token type.
</span>全文検索設定を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、このパターンにマッチする名前の設定のみが表示されます。
<code class="literal">\dF+</code>形式が使用された場合、使用される全文検索パーサや各パーサトークン型についての辞書リストなど各設定の完全な説明が表示されます。
</p></dd><dt><span class="term"><code class="literal">\dFd[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists text search dictionaries.
If <replaceable class="parameter">pattern</replaceable> is specified,
only dictionaries whose names match the pattern are shown.
If the form <literal>\dFd+</literal> is used, additional information
is shown about each selected dictionary, including the underlying
text search template and the option values.
</span>全文検索辞書を一覧表示します。
<em class="replaceable"><code>pattern</code></em>が指定された場合、このパターンにマッチする名前の辞書のみが表示されます。
<code class="literal">\dFd+</code>形式が使用された場合、選択された辞書それぞれについて使用される全文検索テンプレートやオプション値など更なる情報が表示されます。
</p></dd><dt><span class="term"><code class="literal">\dFp[+] [ <a class="link" href="app-psql.html#app-psql-patterns" title="パターン"><em class="replaceable"><code>pattern</code></em></a> ]</code></span></dt><dd><p><span class="original">
Lists text search parsers.
If <replaceable class="parameter">pattern</replaceable> is specified,
only parsers whose names match the pattern are shown.
If the form <literal>\dFp+</literal> is used, a full description of