ALTER TABLE ttest ALTER COLUMN col1 TYPE bytea;下記のように明示的に指定すると変更が可能です。
ALTER TABLE ttest ALTER COLUMN col1 TYPE bytea USING col1::bytea;
ALTER TABLE ttest ALTER COLUMN col1 TYPE bytea;下記のように明示的に指定すると変更が可能です。
ALTER TABLE ttest ALTER COLUMN col1 TYPE bytea USING col1::bytea;
ALTER TABLE table_hoge ALTER COLUMN column_fuga TYPE bytea USING CAST(column_fuga AS bytea);
pg_ctl -D データディレクトリ -P ポート番号 startなど例)pg_ctl -D /home/hoge/data -P 5433 start
createuser -a -d -U ユーザ名 -P ユーザ名(パスワード入力プロンプト表示) --port=ポート番号;例)createuser -a -d -U hoge -P hoge --port=5433 ;
createdb -E UTF-8 -O 所有者 -U 接続するユーザ名 データベース名 --port=5433;例)createdb -E UTF-8 -O hoge -U fuga hoge --port=ポート番号;
rpm -ivh http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
yum install --enablerepo=pgdg92 postgresql92*
service postgresql-9.2 initdb
service postgresql-9.2 start
chkconfig postgresql-9.2 on
chkconfig --list | grep postgresql-9.2
passwd postgres
su - postgres
createuser -a -d -U postgres -P ユーザ名
createdb -E UTF-8 -O オーナー -U postgres データベース名
pg_dump データベース名 -b -o -Fc > バックアップファイル名例)pg_dump hogedb -b -o -Fc > hogedb20130509.pgdmp
pg_restore -U "データベースユーザ名" -d "データベース名" --no-password -v -F c "バックアップファイル名"例)pg_restore -U "fugauser" -d "hogedb" --no-password -v -F c "hogedb20130509.pgdmp"
pg_restore -U "データベースユーザ名" -d "データベース名" --no-password -t "テーブル名" -v -F c -a "バックアップファイル名"例)pg_restore -U "fugauser" -d "hogedb" --no-password -t "footable" -v -F c -a "hogedb20130509.pgdmp"