- PostgreSQL 8.0 on XP
- 結局今回も
- PostgreSQLのVACUUME
- PostgreSQL on Mac OS X(Intel)
- PostgreSQLの困ったエラー
- postgresql-8.2-ja.msi
- PostgreSQLの謎
- 64ビット版のVistaでPostgreSQLをODBC経由で使うには
- PostgreSQL 8.4への移行で苦戦中
- PostgreSQL 9.0への移行~失敗編~
- npm install pgだけでは済まない件
- OSXで最速でOCamlでPostgresqlに接続するには
- mrubyでPostgres.appを使って、LOBも扱ってみた
- まさかPostgreSQLを触って、IPv6の知識が増えるとは
- WindowsでPostgreSQLをソースからビルドした
- PostgreSQLの機能拡張をWindowsでC++混在で作ろうとするとハマると分かった事2点
cpan install DBD::Pg
gem install pg
opam install postgresql-ocaml
$sth->execute
$sth->rows
と出来るが、DBD::Pgに関しては、SELECTのEXECUTEの返却値に件数が入っている。(俺の英語力での理解) (ほかのDBDモジュールではそもそもrowsで取得件数が入らないこともありそうな気配。。)
rows
$rv = $sth->rows;
Returns the number of rows returned by the last query. In contrast to many other DBD modules, the
number of rows is available immediately after calling "$sth->execute". Note that the "execute" method
itself returns the number of rows itself, which means that this method is rarely needed.
alter table black_domain alter column itimestamp set default current_timestamp;
select pg_database_size(’databasename’);
select relname,relpages,to_char(reltuples ,'999,999,999,999') from pg_class order by relpages desc;
select
procpid,
start,
now()-start as lap,
current_query
from
(
select
backendid,
pg_stat_get_backend_pid(S.backendid) as procpid,
pg_stat_get_backend_activity_start(S.backendid) as start,
pg_stat_get_backend_activity(S.backendid) as current_query
from
(
select
pg_stat_get_backend_idset() as backendid
) as S
) as S
where
current_query <> '<IDLE>'
order by
lap desc;