ホームページ  >  記事  >  データベース  >  PostgreSQLのバージョン識別の詳しい説明

PostgreSQLのバージョン識別の詳しい説明

jacklove
jackloveオリジナル
2018-06-11 17:22:422325ブラウズ

Insertdeleteupdate ctidで検索し、レコードxminxmaxへの変更を表示します。

Xid: データベーストランザクション ID;

ID : 削除または ロック 記録されたトランザクション ID

xid_snapshot: に終了したトランザクション現在のクラスター Clog: トランザクション送信ステータス ログ レコード形式の定義: htup_ 詳細。 h

:

POSTGRES ヒープ タプル ヘッダー定義。

1) すべての

xid

関連関数を表示します。ここで必要なのは txid_current

関数です

2)

現在のトランザクションを確認できますID

postgres=# select * from txid_current();
 txid_current
--------------
         1676
(1 row)
 
3)进行一次insert后,看事务ID已经+1
postgres=# insert into tt values(1);
INSERT 0 1
postgres=# select ctid,xmin,xmax,cmin,cmax,id from tt;
 ctid  | xmin | xmax | cmin | cmax | id
-------+------+------+------+------+----
 (0,1) | 1677 |    0 |    0 |    0 |  1
(1 row)

4)Afterトランザクションを開始し、実行します 更新

postgres=# begin;
BEGIN
 
postgres=# update tt set id=3;
UPDATE 1
postgres=# select ctid,xmin,xmax,cmin,cmax,id from tt;
 ctid  | xmin | xmax | cmin | cmax | id
-------+------+------+------+------+----
 (0,2) | 1678 |    0 |    0 |    0 |  3
(1 row)

5) 別のセッションで表示

postgres=#  select ctid,xmin,xmax,cmin,cmax,id from tt;
 ctid  | xmin | xmax | cmin | cmax | id
-------+------+------+------+------+----
 (0,1) | 1677 | 1678 |    0 |    0 |  1
(1 row)

現在の未完了のトランザクション、または未開封のトランザクションを確認します


rreee

記録トランザクションが送信されたかどうかは、このファイルの bit

:

postgres=# select *from txid_current_snapshot();
 txid_current_snapshot
-----------------------
 1684:1684:
(1 row)
 
postgres=# select * from txid_current();
 txid_current
--------------
         1684
(1 row)
この記事の紹介 PostgreSQL のバージョン識別、その他の関連コンテンツについては、php 中国語 Web サイトに注意してください。

関連する推奨事項:

B/S と C/S とは何かを説明する

css3+html5 を使用して垂直メニューを実装する方法

HTML5 ローカル ストレージに関する関連説明

以上がPostgreSQLのバージョン識別の詳しい説明の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。