could not bind IPv4 socket: Cannot assign requested address エラー by PostgreSQL

Aug 6, 2013
AD:

VagrantのUbuntuにPostgreSQLをインストールして、立ち上げようとすると下記のようなエラーがでたので、メモしておきます。

エラー内容

解決方法

コネクション指定の問題なので、下記のように変更しました。

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0

PostgreSQL 8.1.3→PostgreSQL 9.1.2に変更したらJoinでトラブった件

Mar 23, 2012
AD:

先月、とあるシステムをPostgreSQL 8.1.3→PostgreSQL 9.1.2にアップグレードしたら、既存システムが動かなくなった。
よく調べてみるとSQLのJoin部分のKeyの型がcharacterだと接続エラーになっていました。

解決方法

で、単純に下記のSQLで型を変更しようと思ったのですが、場所によっては下記のSQLでは型変更ができないところがありました。

解決方法(IndexやViewがある場合)

また調べてみると変更しようとしたKeyがIndexやViewの中でも使用されていることが判明
なので、変更対象のKeyが使用されているIndexやViewをいったん削除して、上記SQLを再度実行して、その後に、削除したIndexやViewを復元させて、
事無きを得ました。ちゃんちゃん

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0

PostgresSQL9.1.2の設定 in CentOS5.7

Feb 21, 2012
AD:

基本設定部分

[php]
$ vi /var/lib/pgsql/9.1/data/postgresql.conf
#listen_addresses = ‘localhost’

listen_addresses = ‘*’
#port = 5432

port = 5432

ログの名前
log_filename = ‘postgresql-%Y-%m-%d_%H%M.log’
ログのローテーション
log_rotation_age = 1d
ログのサイズ
log_rotation_size = 2MB
同名のファイルが存在する時は上書きする。ローテーション用。
log_truncate_on_rotation = on
ログのレベル
log_min_error_statement = error
[/php]

ログの細かい内容はこちらを参照してください。
http://lets.postgresql.jp/documents/technical/log_setting

セキュリティ設定部分

[php]
$ vi /var/lib/pgsql/9.1/data/pg_hba.conf
ローカル接続の許可
local all all peer
外部からの接続の設定
host all all 123.123.123.123/32(接続元のIP) password
[/php]

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0

CentOS5.7にPostgresSQL9.1.2をyumでインストール

Feb 13, 2012
AD:

Postgresのサイトからrpmを取得
http://yum.postgresql.org/reporpms/

インストール

[php]
$ wget http://yum.postgresql.org/9.1/redhat/rhel-5-i386/pgdg-centos91-9.1-4.noarch.rpm
$ rpm -ivh pgdg-centos91-9.1-4.noarch.rpm
$ vi /etc/yum.repos.d/CentOS-Base.repo
[base]の中に下記のコメントを追加
exclude=postgresql*
[update]の中に下記のコメントを追加
exclude=postgresql*
$ yum -y install postgresql-server
Installed:
postgresql91-server.i386 0:9.1.2-1PGDG.rhel5
Dependency Installed:
postgresql91.i386 0:9.1.2-1PGDG.rhel5 postgresql91-libs.i386 0:9.1.2-1PGDG.rhel5
[/php]

初期設定

[php]
$ chkconfig postgresql-9.1 on
DBの初期化
$ service postgresql-9.1 initdb
データベースを初期化中: mkdir: ディレクトリ `/var/lib/pgsql/9.1/data/pg_log’ を作成できません: ファイルが存在します
$ rm -rf /var/lib/pgsql/9.1/data/pg_log/
$ service postgresql-9.1 initdb
データベースを初期化中: [ OK ]
$ service postgresql-9.1.2 start
postgresql-9.1 サービスを開始中: [ OK ]
$ su – postgres
$ psql -V
psql (PostgreSQL) 9.1.2
[/php]

設定関連

[php]
基本関係
$ vi /var/lib/pgsql/9.1/data/postgresql.conf
セキュリティ関係
$ vi /var/lib/pgsql/9.1/data/pg_hba.conf
[/php]

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0

What logs does your Postgres dump?

Apr 1, 2009
AD:

What logs does your Postgres dump?
I set these setting on postgresql.conf

log_min_error_statement

Controls whether or not the SQL statement that causes an error condition will be recorded in the server log.

log_min_duration_statement

Causes the duration of each completed statement to be logged if the statement ran for at least the specified number of milliseconds.

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0

How to make testing environment about Postgres.

Mar 31, 2009
AD:

I often use postgres server,so sometimes I have to make testing environment for postgres in my windows pc.
So I want to write how to make testing environment about Postgres for my memo.

postgres

First Step

Please login postgres server, and then you have to change user what this user is postgres user.
And I use pg_dump.

-f to write file about output.
-Z。。Number this is level of compression.
-c it is cleaning for schema.

Second Step

You get dump file from server.And then you decompress file.

Third Step

You install postgres in your windows PC. Please check Postgres sites.

Fourth Step

Please copy dump file to there.


And please open command prompt and write this command.

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0

初心者用pg_dumpの方法

Apr 30, 2008
AD:

pg_dumpは

を実行すればできると、あるが実際はいろいろと気をつけないことが、たくさんあるのでそのメモ

その一、ユーザの準備
postgresでDBを作成しているなら、postgresユーザがいります。

このときに、ホームディレクトリーも作っておきます。

その二、ファイルの準備
先ほど上のつくったホームディレクトリーの中にdatabase_name.sqlのファイルを作っておきます。

その三、bushが引けてない場合があるのでlocateでpg_dumpを調べてひいいておきましょう。

その四、いざ実行

Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 2 | Pocket: 0 | Total: 2 | Feedly: 0

Search Keyword

Meta

face Ayumi Mizoshiri
WEB developer

FacebookPage

Popular Posts

Sorry. No data so far.

ARCHIVES