11. SELECT * FROM foo WHERE data = ' 味噌らーめん ';
id | data
----+--------------
1 | 味噌ラーメン
(1 row)
SELECT * FROM foo WHERE data = 'postgresql';
id | data
----+----------------------
2 | PostgreSQL
(1 row)
SELECT * FROM foo WHERE data = ' エバンゲリオン ';
id | data
----+------------
3 | エヴァンゲリヲン
(1 row)
SELECT * FROM foo WHERE data = ' センヌリティウス ';
id | data
----+------
(0 rows)
SELECT * FROM foo WHERE data = ' フィロストラス ';
id | data
----+------
(0 rows)
SELECT * FROM foo WHERE data /= ' センヌリティウス ';
id | data
----+------------------
4 | セリヌンティウス
(1 row)
SELECT * FROM foo WHERE data /= ' フィロストラス ';
id | data
----+------------------
5 | フィロストラトス
(1 row)
日本語正規化
+
typo を許容
13. Neo4j Server
Neo4j Foriegn Data Wrapper
PostgreSQL
REST I/FCypher
Query
JSON
Result
SQL
PostgreSQL
Record
Set Cypher Query
Execute Cypher Query on REST
Generate PostgreSQL Record
Neo4j-FDW
Concept
Do not convert SQL into Cypher!
18. psql からの実行例
postgres=# LISTEN HB_CL;
LISTEN
postgres=# NOTIFY HB_SV,'xxxx';;
NOTIFY
Asynchronous notification "hb_cl" with payload "Invalid data.(xxxx)"
received from server process with PID 29520.
postgres=# NOTIFY HB_SV,'0123';;
NOTIFY
Asynchronous notification "hb_cl" with payload "2 Hit / 1 Blow."
received from server process with PID 29520.
postgres=# NOTIFY HB_SV,'0813';;
NOTIFY
Asynchronous notification "hb_cl" with payload "4 Hit! Conguratulatoins!, next new game."
received from server process with PID 29520.
postgres=#
hb_worker の応答
LOG: NOTIFY HB_CL,'2 Hit / 1 Blow.'
LOG: hb_worker: NOTIFY HB_CL,'4 Hit! Conguratulatoins!, next new game.'
LOG: hb_worker: set secret number=0391
(注:見やすさのために適宜改行している)
psql から数当て
21. [nuko]$ LOG: loaded library "hartmanhook"
LOG: database system was shut down at 2014-02-16 04:45:33 PST
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
[nuko]$ psql test
psql (9.3.2)
Type "help" for help.
test=# SELECT 1;
NOTICE: Sir, yes, sir!
?column?
----------
1
(1 row)
test=# d
NOTICE: Sir, yes, sir!
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
public | test | table | harada
(1 row)
test=#
SQL を投げると
ハートマン軍曹から
罵ってもらえます
(現在実装中)