ドルヲタ系インフラエンジニア じーふーの備忘録

クラウドをメインに扱うインフラエンジニアが書くメモやら雑感、たまにドルヲタ的活動記録残します。最近の推しはAzureのData Factory(V2)です。

【postgresql】 psql出力結果をファイルに出力させる

psql起動時に-o [ファイル名]オプションを付けて出力先を指定することで、psqlで実行したクエリの結果をファイルに出力できます。

実行ログ

[postgres@vagrant-centos65 ~]$ /usr/local/pgsql/bin/psql test -q -t -o result.out
test=#
test=#
test=# \qecho hoge fuga piyo
test=# select 1,2,3;
test=# \o
test=# select 4,5,6;
        4 |        5 |        6

test=# \q
[postgres@vagrant-centos65 ~]$
[postgres@vagrant-centos65 ~]$
[postgres@vagrant-centos65 ~]$
[postgres@vagrant-centos65 ~]$ cat result.out
hoge fuga piyo
        1 |        2 |        3

[postgres@vagrant-centos65 ~]$

各オプション説明

オプション名 説明 ヘルプ内容
-q(--quit) メッセージ出力(psql起動時のwelcomeメッセージ等)を省略 run quietly (no messages, only query output)
-t(--tuples-only) カラム名と行数フッタ出力を省略 print rows only
-o(--output) [ファイル名] クエリ出力結果をファイルにリダイレクト send query results to file (or |pipe)

メタコマンド説明

オプション名 説明 ヘルプ内容
\qecho [出力文言] 出力文言をファイルに出力 write string to query output stream (see \o)
\o [ファイル名] クエリ実行結果をファイルに出力 send all query results to file or |pipe

注意

  • psqlプロンプトで\o実行後は標準出力に出力されるようになります。
  • -o オプション指定時に、psql内で文言出力したい場合は \qechoを使用すべき。

【postgresql】 メタコマンドの詳細確認

psql起動時に-Eオプションをつけることで、メタコマンドが内部的に実行しているqueryを見ることが出来ます。

実行ログ

[postgres@vagrant-centos65 ~]$ /usr/local/pgsql/bin/psql test -E
psql (9.3.5)
Type "help" for help.

test=#
test=#
test=# \dt
********* QUERY **********
SELECT n.nspname as "Schema",
  c.relname as "Name",
  CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special' WHEN 'f' THEN 'foreign table' END as "Type",
  pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','')
      AND n.nspname <> 'pg_catalog'
      AND n.nspname <> 'information_schema'
      AND n.nspname !~ '^pg_toast'
  AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2;
**************************

No relations found.
test=#

-E オプションのヘルプ

  -E, --echo-hidden        display queries that internal commands generate

【linux / postgresql】 自作パッチファイル適用方法(postgresql 9.3.5ソース修正)

自作パッチファイルの作成・適用方法をメモします。
今回はPostgreSQL 9.3.5のソースを修正し、エラーメッセージの文言を変更する方法を試します。

変更対象

今回は下記エラーメッセージを以下のように変えてみました。

$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data2/ -A md5
initdb: must specify a password for the superuser to enable md5 authentication

↓ パッチ適用後

$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data2/ -A md5
hogehoge fugafuga piyopiyo

パッチファイル作成

パッチファイルを作成する方法として、今回はdiffコマンドを利用します。

修正対象

/tmp/work/postgresql-9.3.5/src/bin/initdb/initdb.cの2812行目に記述されているエラーメッセージを変更します。

2803 static void
2804 check_need_password(const char *authmethodlocal, const char *authmethodhost)
2805 {
2806         if ((strcmp(authmethodlocal, "md5") == 0 ||
2807                  strcmp(authmethodlocal, "password") == 0) &&
2808                 (strcmp(authmethodhost, "md5") == 0 ||
2809                  strcmp(authmethodhost, "password") == 0) &&
2810                 !(pwprompt || pwfilename))
2811         {
2812                 fprintf(stderr, _("%s: must specify a password for the superuser to enable      %s authentication\n"), progname,
2813                                 (strcmp(authmethodlocal, "md5") == 0 ||
2814                                  strcmp(authmethodlocal, "password") == 0)
2815                                 ? authmethodlocal
2816                                 : authmethodhost);
2817                 exit(1);
2818         }
2819 }

修正の流れ

  • バックアップ作成
$ cd /tmp/work/postgresql-9.3.5
$ cp src/bin/initdb/initdb.c{,.bak}
$ ll src/bin/initdb/
total 760
lrwxrwxrwx 1 vagrant vagrant     40 May  1 10:32 encnames.c -> ../../../src/backend/utils/mb/encnames.c
-rw-rw-r-- 1 vagrant vagrant  23528 May  1 10:32 encnames.o
-rw-r--r-- 1 vagrant vagrant  34675 Jul 22  2014 findtimezone.c
-rw-rw-r-- 1 vagrant vagrant  26176 May  1 10:32 findtimezone.o
-rwxrwxr-x 1 vagrant vagrant 253846 May  1 10:32 initdb
-rw-r--r-- 1 vagrant vagrant  92377 Jul 22  2014 initdb.c
-rw-r--r-- 1 vagrant vagrant  92377 May  1 10:43 initdb.c.bak   <=# バックアップ作成
-rw-rw-r-- 1 vagrant vagrant 165944 May  1 10:32 initdb.o
lrwxrwxrwx 1 vagrant vagrant     33 May  1 10:32 localtime.c -> ../../../src/timezone/localtime.c
-rw-rw-r-- 1 vagrant vagrant  64824 May  1 10:32 localtime.o
-rw-r--r-- 1 vagrant vagrant   1721 Jul 22  2014 Makefile
-rw-r--r-- 1 vagrant vagrant    270 Jul 22  2014 nls.mk
drwxrwxr-x 2 vagrant vagrant   4096 Jul 22  2014 po
  • 修正
2812               fprintf(stderr, _("%s: must specify a password for the superuser to enable      %s authentication\n"), progname,

↓
2812                fprintf(stderr, _("hogehoge fugafuga piyopiyo\n"), progname,
  • diffコマンドを利用しパッチファイル作成
$ diff -u src/bin/initdb/initdb.c.bak src/bin/initdb/initdb.c > err_msg_u.patch
$ cat err_msg_u.patch
--- src/bin/initdb/initdb.c.bak 2015-05-01 10:43:15.921200076 +0900
+++ src/bin/initdb/initdb.c     2015-05-01 10:49:50.347199840 +0900
@@ -2809,7 +2809,7 @@
                 strcmp(authmethodhost, "password") == 0) &&
                !(pwprompt || pwfilename))
        {
-               fprintf(stderr, _("%s: must specify a password for the superuser to enable %s authentication\n"), progname,
+               fprintf(stderr, _("hogehoge fugafuga piyopiyo\n"), progname,
                                (strcmp(authmethodlocal, "md5") == 0 ||
                                 strcmp(authmethodlocal, "password") == 0)
                                ? authmethodlocal

パッチファイル適用

patchコマンドを実行してdiffコマンドで作成したパッチファイルを適用します。

パッチファイル適用の流れ

  • patchコマンドを実行しパッチ適用
$ patch -p0 < err_msg_u.patch
patching file src/bin/initdb/initdb.c
Reversed (or previously applied) patch detected!  Assume -R? [n] # enter
Apply anyway? [n] # enter
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/bin/initdb/initdb.c.rej
  • 確認
$ ll src/bin/initdb/
total 764
lrwxrwxrwx 1 vagrant vagrant     40 May  1 10:32 encnames.c -> ../../../src/backend/utils/mb/encnames.c
-rw-rw-r-- 1 vagrant vagrant  23528 May  1 10:32 encnames.o
-rw-r--r-- 1 vagrant vagrant  34675 Jul 22  2014 findtimezone.c
-rw-rw-r-- 1 vagrant vagrant  26176 May  1 10:32 findtimezone.o
-rwxrwxr-x 1 vagrant vagrant 253846 May  1 10:32 initdb
-rw-r--r-- 1 vagrant vagrant  92328 May  1 10:49 initdb.c
-rw-r--r-- 1 vagrant vagrant  92377 May  1 10:43 initdb.c.bak
-rw-r--r-- 1 vagrant vagrant    525 May  1 11:01 initdb.c.rej
-rw-rw-r-- 1 vagrant vagrant 165944 May  1 10:32 initdb.o
lrwxrwxrwx 1 vagrant vagrant     33 May  1 10:32 localtime.c -> ../../../src/timezone/localtime.c
-rw-rw-r-- 1 vagrant vagrant  64824 May  1 10:32 localtime.o
-rw-r--r-- 1 vagrant vagrant   1721 Jul 22  2014 Makefile
-rw-r--r-- 1 vagrant vagrant    270 Jul 22  2014 nls.mk
drwxrwxr-x 2 vagrant vagrant   4096 Jul 22  2014 po
$ view src/bin/initdb/initdb.c
   2803 static void
   2804 check_need_password(const char *authmethodlocal, const char *authmethodhost)
   2805 {
   2806         if ((strcmp(authmethodlocal, "md5") == 0 ||
   2807                  strcmp(authmethodlocal, "password") == 0) &&
   2808                 (strcmp(authmethodhost, "md5") == 0 ||
   2809                  strcmp(authmethodhost, "password") == 0) &&
   2810                 !(pwprompt || pwfilename))
   2811         {
   2812                 fprintf(stderr, _("hogehoge fugafuga piyopiyo\n"), progname,
   2813                                 (strcmp(authmethodlocal, "md5") == 0 ||
   2814                                  strcmp(authmethodlocal, "password") == 0)
   2815                                 ? authmethodlocal
   2816                                 : authmethodhost);
   2817                 exit(1);
   2818         }
   2819 }

PostgreSQLの再コンパイル、インストール

コンパイルからインストールまで

$ ./configure
$ gmake
$ su -
# cd /tmp/work/postgresql-9.3.5
# gmake install

~中略~

PostgreSQL installation complete.

結果確認

$ su - postgres
$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data2/ -A md5
hogehoge fugafuga piyopiyo

適用パッチを戻す場合

patchコマンド実行時に -Rオプションを付けることでリバースパッチ適用となります。

$ patch -R -p0 < err_msg_u.patch
patching file src/bin/initdb/initdb.c
   2812                 fprintf(stderr, _("%s: must specify a password for the superuser to enab        le %s authentication\n"), progname,

【postgresql】 データベースクラスタの作成

環境

CentOS 6.5(64bit) PostgreSQL 9.3.5

そもそもPostgreSQLの"データベースクラスタ"とは??

1つのデータベースインスタンスが管理するデータベースの集合体。
複数冗長化されたデータベースを一つのデータベースに仮想的に見せる、と言ったような意味で使われるクラスタとは意味が少し異なります。

マニュアル

postgres$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
       The "-D" option specifies the location where the data will be
       stored. You can use any path you want, it does not have to be under
       the installation directory. Just make sure that the server account
       can write to the directory (or create it, if it doesn't already
       exist) before starting "initdb", as illustrated here.
    3. At this point, if you did not use the "initdb" -A option, you might
       want to modify "pg_hba.conf" to control local access to the server
       before you start it. The default is to trust all local users.
    4. The previous "initdb" step should have told you how to start up the
       database server. Do so now. The command should look something like:
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
       This will start the server in the foreground. To put the server in
       the background use something like:
nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \
    </dev/null >>server.log 2>&1 </dev/null &
       To stop a server running in the background you can type:
kill `cat /usr/local/pgsql/data/postmaster.pid`

コマンド

$ $PGHOME/bin/initdb -D [データベースクラスタ作成先]

実行ログ

[postgres@vagrant-centos65 ~]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data/
or
    /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data/ -l logfile start

[postgres@vagrant-centos65 ~]$

データベースクラスタ構成

[postgres@vagrant-centos65 ~]$ ll /usr/local/pgsql/data/
total 92
drwx------ 5 postgres postgres  4096 May  1 08:59 base
drwx------ 2 postgres postgres  4096 May  1 08:59 global
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_clog
-rw------- 1 postgres postgres  4476 May  1 08:59 pg_hba.conf
-rw------- 1 postgres postgres  1636 May  1 08:59 pg_ident.conf
drwx------ 4 postgres postgres  4096 May  1 08:59 pg_multixact
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_notify
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_serial
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_snapshots
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_stat
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_stat_tmp
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_subtrans
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_tblspc
drwx------ 2 postgres postgres  4096 May  1 08:59 pg_twophase
-rw------- 1 postgres postgres     4 May  1 08:59 PG_VERSION
drwx------ 3 postgres postgres  4096 May  1 08:59 pg_xlog
-rw------- 1 postgres postgres 20547 May  1 08:59 postgresql.conf

【雑感】「何か困っていることありますか?」

Qiitaのこの記事を読んで今後自分も実践していこうと思いましたのでメモ

qiita.com

【postgrsql】 ソースからのインストール & configureオプションメモ

環境

postgresql 9.3.5 CentOS 6.5(64bit)

メモ

インストールの流れ確認

./postgresql-9.3.5/INSTALLファイルを確認。

./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

必要パッケージ

./configure 実行時に下記パッケージがインストールされていないとエラーになります。
対処方法を列挙します。

readline-devel

zlib-devel

  • zlib-devel インストール
    sudo yum -y install zlib-devel
  • --without-zlib オプションを付けて ./configure 実行

    Zlibライブラリの使用を抑制します。 これは、pg_dumpとpg_restoreにおける圧縮アーカイブのサポートを無効にします。 このオプションは、このライブラリが利用できないごく少数のシステム向けだけのものです。
    引用元: https://www.postgresql.jp/document/9.3/html/install-procedure.html

openssl-devel

--with-opensslオプション指定でconfigure実行時、このパッケージが求められます。

checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL
  • openssl-devel インストール sudo yum -y install zlib-devel

    SSL(暗号化)接続のサポートを有効にして構築します。 これには、OpenSSLパッケージがインストールされていなければなりません。 configureは、処理を進める前にOpenSSLのインストールを確認するために、必要なヘッダファイルとライブラリを検査します。 引用元: https://www.postgresql.jp/document/9.3/html/install-procedure.html

PostgreSQLデバッグするには

--enable-debugオプションを付けて./configure 実行。

参考:

PostgreSQL の構造とソースツリー(3) — Let's Postgres

configureオプション

詳細は./postgresql-9.3.5/INSTALLファイルを確認した方がいいと思いますが、各オプションの簡易的な説明確認のため、./configure --help出力結果を記載しておきます。

[vagrant@vagrant-centos65 postgresql-9.3.5]$ ./configure --help
`configure' configures PostgreSQL 9.3.5 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local/pgsql]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/pgsql/bin', `/usr/local/pgsql/lib' etc.  You can specify
an installation prefix other than `/usr/local/pgsql' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/postgresql]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-integer-datetimes
                          disable 64-bit integer date/time support
  --enable-nls[=LANGUAGES]
                          enable Native Language Support
  --disable-rpath         do not embed shared library search path in
                          executables
  --disable-spinlocks     do not use spinlocks
  --enable-debug          build with debugging symbols (-g)
  --enable-profiling      build with profiling enabled
  --enable-coverage       build with coverage testing instrumentation
  --enable-dtrace         build with DTrace support
  --enable-depend         turn on automatic dependency tracking
  --enable-cassert        enable assertion checks (for debugging)
  --disable-thread-safety disable thread-safety in client libraries
  --disable-largefile     omit support for large files
  --disable-float4-byval  disable float4 passed by value
  --disable-float8-byval  disable float8 passed by value

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-template=NAME    override operating system template
  --with-includes=DIRS    look for additional header files in DIRS
  --with-libraries=DIRS   look for additional libraries in DIRS
  --with-libs=DIRS        alternative spelling of --with-libraries
  --with-pgport=PORTNUM   set default port number [5432]
  --with-blocksize=BLOCKSIZE
                          set table block size in kB [8]
  --with-segsize=SEGSIZE  set table segment size in GB [1]
  --with-wal-blocksize=BLOCKSIZE
                          set WAL block size in kB [8]
  --with-wal-segsize=SEGSIZE
                          set WAL segment size in MB [16]
  --with-CC=CMD           set compiler (deprecated)
  --with-tcl              build Tcl modules (PL/Tcl)
  --with-tclconfig=DIR    tclConfig.sh is in DIR
  --with-perl             build Perl modules (PL/Perl)
  --with-python           build Python modules (PL/Python)
  --with-gssapi           build with GSSAPI support
  --with-krb5             build with Kerberos 5 support
  --with-krb-srvnam=NAME  default service principal name in Kerberos
                          [postgres]
  --with-pam              build with PAM support
  --with-ldap             build with LDAP support
  --with-bonjour          build with Bonjour support
  --with-openssl          build with OpenSSL support
  --with-selinux          build with SELinux support
  --without-readline      do not use GNU Readline nor BSD Libedit for editing
  --with-libedit-preferred
                          prefer BSD Libedit over GNU Readline
  --with-ossp-uuid        build contrib/uuid-ossp, requires OSSP UUID library
  --with-libxml           build with XML support
  --with-libxslt          use XSLT support when building contrib/xml2
  --with-system-tzdata=DIR
                          use system time zone data in DIR
  --without-zlib          do not use Zlib
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  LDFLAGS_EX  extra linker flags for linking executables only
  LDFLAGS_SL  extra linker flags for linking shared libraries only
  DOCBOOKSTYLE
              location of DocBook stylesheets

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <pgsql-bugs@postgresql.org>.
[vagrant@vagrant-centos65 postgresql-9.3.5]$

./configure実行ログからエラー項目抽出

自分の環境でデフォルトで ./configure実行時にログに出力されたエラー項目を抽出してみました。 ヘッダファイルがないよというエラーがいくつかあるのが気になるのですが、詳細不明ですので引き続き調べてみます。

[vagrant@vagrant-centos65 postgresql-9.3.5]$ grep -e "^conftest.c.*error.*" ./config.log
conftest.c:22: error: 'choke' undeclared (first use in this function)
conftest.c:22: error: (Each undeclared identifier is reported only once
conftest.c:22: error: for each function it appears in.)
conftest.c:22: error: expected ';' before 'me'
conftest.c:22: error: 'choke' undeclared (first use in this function)
conftest.c:22: error: (Each undeclared identifier is reported only once
conftest.c:22: error: for each function it appears in.)
conftest.c:22: error: expected ';' before 'me'
conftest.c:17:28: error: ac_nonexistent.h: No such file or directory
conftest.c:17:28: error: ac_nonexistent.h: No such file or directory
conftest.c:67:17: error: dld.h: No such file or directory
conftest.c:34:17: error: dld.h: No such file or directory
conftest.c:67:22: error: fp_class.h: No such file or directory
conftest.c:34:22: error: fp_class.h: No such file or directory
conftest.c:68:20: error: ieeefp.h: No such file or directory
conftest.c:35:20: error: ieeefp.h: No such file or directory
conftest.c:75:23: error: sys/pstat.h: No such file or directory
conftest.c:42:23: error: sys/pstat.h: No such file or directory
conftest.c:80:24: error: sys/sockio.h: No such file or directory
conftest.c:47:24: error: sys/sockio.h: No such file or directory
conftest.c:80:21: error: sys/tas.h: No such file or directory
conftest.c:47:21: error: sys/tas.h: No such file or directory
conftest.c:83:19: error: ucred.h: No such file or directory
conftest.c:50:19: error: ucred.h: No such file or directory
conftest.c:90:23: error: sys/ucred.h: No such file or directory
conftest.c:59: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
conftest.c:65: error: 'not' undeclared (first use in this function)
conftest.c:65: error: (Each undeclared identifier is reported only once
conftest.c:65: error: for each function it appears in.)
conftest.c:65: error: expected ';' before 'big'
conftest.c:76: error: invalid application of 'sizeof' to incomplete type 'union semun'
conftest.c:78: error: expected expression before ')' token
conftest.c:79: error: expected expression before ')' token
conftest.c:82: error: 'struct sockaddr_storage' has no member named '__ss_family'
conftest.c:82: error: 'struct sockaddr_storage' has no member named '__ss_family'
conftest.c:82: error: 'struct sockaddr_storage' has no member named 'ss_len'
conftest.c:82: error: 'struct sockaddr_storage' has no member named 'ss_len'
conftest.c:82: error: 'struct sockaddr_storage' has no member named '__ss_len'
conftest.c:82: error: 'struct sockaddr_storage' has no member named '__ss_len'
conftest.c:82: error: 'struct sockaddr' has no member named 'sa_len'
conftest.c:82: error: 'struct sockaddr' has no member named 'sa_len'
conftest.c:80: error: expected expression before ')' token
conftest.c:109: error: expected expression before ')' token
conftest.c:110: error: expected expression before ')' token
conftest.c:86: error: invalid application of 'sizeof' to incomplete type 'struct cmsgcred'
conftest.c:84: error: expected expression before ')' token
conftest.c:83: error: expected expression before ')' token
conftest.c:86: error: conflicting types for 'accept'
conftest.c:86: error: conflicting types for 'accept'
conftest.c:142: error: 'strlcat' undeclared (first use in this function)
conftest.c:142: error: (Each undeclared identifier is reported only once
conftest.c:142: error: for each function it appears in.)
conftest.c:143: error: 'strlcpy' undeclared (first use in this function)
conftest.c:143: error: (Each undeclared identifier is reported only once
conftest.c:143: error: for each function it appears in.)
conftest.c:113: error: 'F_FULLFSYNC' undeclared (first use in this function)
conftest.c:113: error: (Each undeclared identifier is reported only once
conftest.c:113: error: for each function it appears in.)
conftest.c:146: error: expected expression before ')' token
conftest.c:109:29: error: machine/vmparam.h: No such file or directory
conftest.c:110:22: error: sys/exec.h: No such file or directory
conftest.c:115: error: 'PS_STRINGS' undeclared (first use in this function)
conftest.c:115: error: (Each undeclared identifier is reported only once
conftest.c:115: error: for each function it appears in.)
conftest.c:147: error: conflicting types for 'strerror_r'
conftest.c:163: error: 'int8' undeclared (first use in this function)
conftest.c:163: error: (Each undeclared identifier is reported only once
conftest.c:163: error: for each function it appears in.)
conftest.c:163: error: 'uint8' undeclared (first use in this function)
conftest.c:163: error: (Each undeclared identifier is reported only once
conftest.c:163: error: for each function it appears in.)
conftest.c:163: error: 'int64' undeclared (first use in this function)
conftest.c:163: error: (Each undeclared identifier is reported only once
conftest.c:163: error: for each function it appears in.)
conftest.c:163: error: 'uint64' undeclared (first use in this function)
conftest.c:163: error: (Each undeclared identifier is reported only once
conftest.c:163: error: for each function it appears in.)
conftest.c:163: error: expected expression before ')' token
[vagrant@vagrant-centos65 postgresql-9.3.5]$

【oracle】 非推奨パラメータの探し方

v$parameterビューのISDEPRECATEDがTRUEのパラメータは非推奨パラメータ。
(マニュアルにも書いてあるのでそれを見れば早い話ですが…)

SQL

SELECT name from v$parameter WHERE ISDEPRECATED = 'TRUE' ORDER BY name;

参考

Oracle Database 12cで非推奨となった機能とサポートが終了した機能

KEEP pool deprecated in 12c