iakioの日記 RSSフィード

2009-11-20

10年前のPostgreSQL

23:47 | 10年前のPostgreSQL - iakioの日記 を含むブックマーク はてなブックマーク - 10年前のPostgreSQL - iakioの日記

勝手にJPUG10周年企画。10年前というとPostgreSQLは6.5.3あたりのようです。6.5というとMVCCが実装されたバージョンです。僕はこのころ既にPostgreSQLを使っていたのでmakeは簡単だろうと思ったのですが。

$ hg st
M src/backend/commands/copy.c
M src/backend/libpq/pqformat.c
M src/backend/storage/ipc/ipc.c
M src/backend/utils/error/elog.c
M src/backend/utils/error/exc.c
M src/backend/utils/init/postinit.c
M src/configure
M src/include/postgres.h

結構大変でした。ちなみに環境はVirtualBox上のCentOS5.4です。まあビルドできたのでinitdb。

$ initdb
initdb does not know where to find the files that make up
Postgres (the PGLIB directory).  You must identify the PGLIB
directory either with a --pglib invocation option, or by
setting the PGLIB environment variable, or by having a program
called 'postconfig' in your search path that outputs an asignment
for PGLIB.
$ initdb -h
Unrecognized option '-h'.  Syntax is:
initdb [-t | --template] [-d | --debug] [-n | --noclean] [-u SUPERUSER | --usern
ame=SUPERUSER] [-r DATADIR | --pgdata=DATADIR] [-l LIBDIR | --pglib=LIBDIR]
$ initdb --help
Unrecognized option '--help'.  Syntax is:
initdb [-t | --template] [-d | --debug] [-n | --noclean] [-u SUPERUSER | --usern
ame=SUPERUSER] [-r DATADIR | --pgdata=DATADIR] [-l LIBDIR | --pglib=LIBDIR]

マジですかw。10年前ってこんなんだっけ。まあ色々あってinitdbもできましたが、postgresql.confってまだ無いんですね。

$ psql
Welcome to the POSTGRESQL interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc gcc (GCC) 4.1.2 20080704
 (Red Hat 4.1.2-46)]

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: ishida

よし。8.4.1版のpgbenchを使ってpgbenchだ。

$ ./pgbench -i
ERROR:  parser: parse error at or near "exists"

drop table if existsが使えないorz。つーかtruncateすら無い。pgbenchをゴリゴリ修正。動いたか?

 ./pgbench -i
creating tables...
10000 tuples done.
20000 tuples done.
30000 tuples done.
40000 tuples done.
50000 tuples done.
60000 tuples done.
70000 tuples done.
80000 tuples done.
90000 tuples done.
100000 tuples done.
set primary key...
ERROR:  ALTER TABLE/ADD CONSTRAINT not yet implemented

なんか楽しくなってきた。

$ ./pgbench  -c10 -t100
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 10
number of transactions per client: 100
number of transactions actually processed: 1000/1000
tps = 162.552305 (including connections establishing)
tps = 165.774029 (excluding connections establishing)

おお。動いた。ではトランザクション数を増やしてみます。

$ ./pgbench  -c10 -t1000
starting vacuum...end.
Client 1 aborted in state 10. Probably the backend died while processing.
Client 6 aborted in state 10. Probably the backend died while processing.
Client 9 aborted in state 10. Probably the backend died while processing.
NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend died abnormally a
nd possibly corrupted shared memory.
        I have rolled back the current transaction and am going to terminate you
r database system connection and exit.
        Please reconnect to the database system and repeat your query.
NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend died abnormally a
nd possibly corrupted shared memory.
        I have rolled back the current transaction and am going to terminate y
...

お遊び終了。

#pgcon09j会場より

13:15 | #pgcon09j会場より - iakioの日記 を含むブックマーク はてなブックマーク - #pgcon09j会場より - iakioの日記

無事到着。

公式Twitterハッシュタグは#pgcon09jです。

トラックバック - http://postgresql.g.hatena.ne.jp/iakio/20091120