シーケンスの初期値を1からに戻す
デバッグが終了してシーケンスを1からスタートの初期値に戻したかったので
select setval('seq_name', 0); ERROR: setval: value 0 is out of bounds for sequence "seq_name" (1..9223372036854775807)
と叩くとエラー。
0は有効な範囲ではないと怒られるので、is_called フラグを設定して
select setval('seq_name', 1, false);
と実行。
select nextval('seq_name'); nextval ------- 1
CentOS5にpostgresql9.2をインストール
リリースされたそうなので。
リポジトリを追加
wget http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-centos92-9.2-5.noarch.rpm rpm -ivh pgdg-centos92-9.2-5.noarch.rpm
インストール
yum install --enablerepo=pgdg92 postgresql92* postgresql92-contrib-9.2.0-1PGDG.rhel5.x86_64 from pgdg92 has depsolving problems --> Missing Dependency: libossp-uuid.so.15()(64bit) is needed by package postgresql92-contrib-9.2.0-1PGDG.rhel5.x86_64 (pgdg92) Error: Missing Dependency: libossp-uuid.so.15()(64bit) is needed by package postgresql92-contrib-9.2.0-1PGDG.rhel5.x86_64 (pgdg92)
でuuidの1.5以上が必要だそうです。
uuidのインストール
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/uuid-1.5.1-3.el5.x86_64.rpm rpm -Uvh uuid-1.5.1-3.el5.x86_64.rpm
postgresのインストール
yum install --enablerepo=pgdg92 postgresql92* Installed: postgresql92.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-contrib.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-debuginfo.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-devel.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-docs.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-libs.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-plperl.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-plpython.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-pltcl.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-server.x86_64 0:9.2.0-1PGDG.rhel5 postgresql92-test.x86_64 0:9.2.0-1PGDG.rhel5 Complete!