mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-26 22:17:19 +02:00
122 lines
3.8 KiB
Plaintext
122 lines
3.8 KiB
Plaintext
|
$PostgreSQL: pgsql/contrib/pgrowlocks/README.pgrowlocks.euc_jp,v 1.1 2006/04/23 01:12:58 ishii Exp $
|
|||
|
|
|||
|
pgrowlocks README <09>а<EFBFBD>ã<EFBFBD><C3A3>
|
|||
|
|
|||
|
1. pgrowlocks<6B>Ȥ<EFBFBD>
|
|||
|
|
|||
|
pgrowlocks<6B>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>ꤵ<EFBFBD>줿<EFBFBD>ơ<EFBFBD><C6A1>֥<EFBFBD><D6A5>ιԥ<CEB9><D4A5>å<EFBFBD><C3A5>˴ؤ<CBB4><D8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
pgrowlocks<6B><73><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1>ʲ<EFBFBD><CAB2>Τ褦<CEA4>ˤʤ<CBA4><CAA4>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
CREATE TYPE pgrowlocks_type AS (
|
|||
|
locked_row TID, -- row TID
|
|||
|
lock_type TEXT, -- lock type
|
|||
|
locker XID, -- locking XID
|
|||
|
multi bool, -- multi XID?
|
|||
|
xids xid[], -- multi XIDs
|
|||
|
pids INTEGER[] -- locker's process id
|
|||
|
);
|
|||
|
|
|||
|
<20>¹<EFBFBD><C2B9><EFBFBD><EFBFBD><EFBFBD><F2BCA8A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
test=# SELECT * FROM pgrowlocks('t1');
|
|||
|
locked_row | lock_type | locker | multi | xids | pids
|
|||
|
------------+-----------+--------+-------+-----------+---------------
|
|||
|
(0,1) | Shared | 19 | t | {804,805} | {29066,29068}
|
|||
|
(0,2) | Shared | 19 | t | {804,805} | {29066,29068}
|
|||
|
(0,3) | Exclusive | 804 | f | {804} | {29066}
|
|||
|
(0,4) | Exclusive | 804 | f | {804} | {29066}
|
|||
|
(4 rows)
|
|||
|
|
|||
|
<20>ƹ<EFBFBD><C6B9>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>
|
|||
|
|
|||
|
locked_row -- <20><><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>줿<EFBFBD>ԤΥ<D4A4><CEA5>ץ<EFBFBD>ID(TID)
|
|||
|
lock_type -- <20><>ͭ<EFBFBD><CDAD><EFBFBD>å<EFBFBD><C3A5>ʤ<EFBFBD>"Shared"<22><><EFBFBD><EFBFBD>¾<EFBFBD><C2BE><EFBFBD>å<EFBFBD><C3A5>ʤ<EFBFBD>"Exclusive"
|
|||
|
locker -- <20><><EFBFBD>å<EFBFBD><C3A5><EFBFBD><F2A4ABA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><F3A5B6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID[<5B><>1]
|
|||
|
multi -- locker<65><72><EFBFBD>ޥ<EFBFBD><DEA5><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><F3A5B6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD>t<EFBFBD><74><EFBFBD><EFBFBD><EFBFBD>Ǥʤ<C7A4><CAA4><EFBFBD><EFBFBD><EFBFBD>f
|
|||
|
xids -- <20><><EFBFBD>å<EFBFBD><C3A5><EFBFBD><F2A4ABA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><F3A5B6A5><EFBFBD><EFBFBD><EFBFBD><EFB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4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤ<CEA4><C8A4><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PostgreSQL
|
|||
|
8.0<EFBFBD>ʹߤǤ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
<20><><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD>PostgreSQL<51>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/usr/local/src/postgresql-8.1/<2F><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD>
|
|||
|
<20><><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤ<CEA4><C8A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
1) pgrowlocks<6B>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/tmp/pgrowlocks-1.0.tar.gz<67><7A><EFBFBD>֤<EFBFBD><D6A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤ<CEA4><C8A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
$ cd /usr/local/src/postgresql-8.1/contrib
|
|||
|
$ tar xfz pgrowlocks-1.0.tar.gz
|
|||
|
|
|||
|
2) PostgreSQL 8.0<EFBFBD>ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פǤ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
pgrowlocks.c<><63>61<36><31><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4><EFBFBD>
|
|||
|
|
|||
|
#undef MAKERANGEVARFROMNAMELIST_HAS_TWO_ARGS
|
|||
|
|
|||
|
<20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
#define MAKERANGEVARFROMNAMELIST_HAS_TWO_ARGS
|
|||
|
|
|||
|
<20>˽<CBBD><F1A4ADB4><EFBFBD><EFBFBD>ޤ<EFBFBD>(undef->define<6E>ˤ<EFBFBD><CBA4>ޤ<EFBFBD>)<29><>
|
|||
|
|
|||
|
3) <20><><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5>뤷<EFBFBD>ƴؿ<C6B4><D8BF>ζ<EFBFBD>ͭ<EFBFBD>饤<EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD>ȡ<F3A5B9A5><C8A1>뤷<EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
$ make
|
|||
|
$ make install
|
|||
|
|
|||
|
4) <20>桼<EFBFBD><E6A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
$ psql -e -f /usr/local/pgsql/share/contrib/pgrowlocks.sql test
|
|||
|
|
|||
|
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD>"test"<22>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⤷¾<E2A4B7>Υǡ<CEA5>
|
|||
|
<20><><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>ؤ<EFBFBD><D8A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
3. pgrowlocks<6B>λȤ<CEBB><C8A4><EFBFBD>
|
|||
|
|
|||
|
pgrowlocks<6B>θƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϰʲ<CFB0><CAB2>Ǥ<EFBFBD><C7A4><EFBFBD>
|
|||
|
|
|||
|
CREATE OR REPLACE FUNCTION pgrowlocks(text) RETURNS pgrowlocks_type
|
|||
|
AS 'MODULE_PATHNAME', 'pgrowlocks'
|
|||
|
LANGUAGE 'c' WITH (isstrict);
|
|||
|
|
|||
|
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ơ<EFBFBD><C6A1>֥<EFBFBD>̾
|
|||
|
|
|||
|
<20>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pgrowlocks_type<70><65><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>
|
|||
|
|
|||
|
pgrowlocks<6B>ϥơ<CFA5><C6A1>֥<EFBFBD><D6A5><EFBFBD>AccessShareLock<63><6B><EFBFBD>å<EFBFBD><C3A5><EFBFBD><F2A4ABA4><EFBFBD>1<EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ɤ߽Ф<DFBD>
|
|||
|
<20>ƤϹԥ<CFB9><D4A5>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>äƤ<C3A4><C6A4>뤫<EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD>
|
|||
|
<20>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
1) <20><><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD><C6A1>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD><C2BE><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>äƤ<C3A4><C6A4><EFBFBD><EFBFBD>ȡ<EFBFBD>pgrowlocks<6B>μ¹Ԥϥ֥<CFA5><D6A5><EFBFBD>
|
|||
|
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
2) pgrowlocks<6B>μ¹<CEBC><C2B9><EFBFBD><EFBFBD>˿<EFBFBD><CBBF><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>ä<EFBFBD><C3A4>ꡤ<EFBFBD><EAA1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD>ԥ<EFBFBD><D4A5>å<EFBFBD><C3A5>˴ؤ<CBB4><D8A4><EFBFBD>
|
|||
|
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pgrowlocks<6B>μ¹Է<C2B9><D4B7>̤<EFBFBD>ȿ<EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
pgrowlocks<6B>ϥ<EFBFBD><CFA5>å<EFBFBD><C3A5><EFBFBD><EFBFBD>줿<EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>Ƥ<EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><F3A1A5B9><EFBFBD><EFBFBD>Ƥ<C6A4><F2B8ABA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<20>ϡ<EFBFBD><CFA1>ơ<EFBFBD><C6A1>֥<EFBFBD><D6A5><EFBFBD>pgrowlocks<6B><73>locked_rows<77><73><EFBFBD>Ƿ<EFBFBD><C7B7>礷<EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2BCA8A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
|||
|
|
|||
|
SELECT * FROM accounts AS a, pgrowlocks('accounts') AS p WHERE p.locked_ row = a.ctid;
|
|||
|
|
|||
|
|
|||
|
4. pgrowlocks<6B>Υ饤<CEA5><E9A5A4><EFBFBD><EFBFBD><F3A5B9BE><EFBFBD><EFBFBD>ˤĤ<CBA4><C4A4><EFBFBD>
|
|||
|
|
|||
|
pgrowlocks.c<><63><EFBFBD><EFBFBD>Ƭ<EFBFBD>˽Ƥ<F1A4A4A4><C6A4><EFBFBD><EFBFBD>̤<EFBFBD><CCA4>Ǥ<EFBFBD>(<28><><EFBFBD><EFBFBD>BSD<53>饤<EFBFBD><E9A5A4><EFBFBD>˽स<CBBD>Ƥ<EFBFBD>
|
|||
|
<20>ޤ<EFBFBD>)<29><><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>pgrowlocks <20>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>ݾڤǤ<DAA4><C7A4><EFBFBD>pgrowlocks <20><><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<20>Ȥˤ<C8A4><CBA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤤<EFBFBD><EBA4A4><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>̤˴ؤ<CBB4><D8A4>Ƥ<EFBFBD><C6A4><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>餤<EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
5. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
2006/03/21 pgrowlocks <20>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(8.2 current<6E>ǥƥ<C7A5><C6A5><EFBFBD>)
|
|||
|
2005/08/22 pgrowlocks <20>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFB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