@@ -67,7 +67,9 @@ We test this foreign data wrapper on Ubuntu Server 18.04 using PostgreSQL-11 tog
6767
6868Before using this foreign data wrapper, you need to add it to ``` shared_preload_libraries ``` in your ``` postgresql.conf ```
6969
70+ ``` sh
7071 shared_preload_libraries = ' kv_fdw' # (change requires restart)
72+ ```
7173
7274and restart Postgres:
7375
@@ -82,33 +84,33 @@ A simple example is as follows.
8284
8385
8486```
85- CREATE DATABASE kvtest;
86- \c kvtest
87+ CREATE DATABASE kvtest;
88+ \c kvtest
8789
88- CREATE EXTENSION kv_fdw;
89- CREATE SERVER kv_server FOREIGN DATA WRAPPER kv_fdw;
90+ CREATE EXTENSION kv_fdw;
91+ CREATE SERVER kv_server FOREIGN DATA WRAPPER kv_fdw;
9092
91- CREATE FOREIGN TABLE test(key TEXT, value TEXT) SERVER kv_server;
93+ CREATE FOREIGN TABLE test(key TEXT, value TEXT) SERVER kv_server;
9294
93- INSERT INTO test VALUES('YC', 'VidarDB');
94- SELECT * FROM test;
95+ INSERT INTO test VALUES('YC', 'VidarDB');
96+ SELECT * FROM test;
9597
96- INSERT INTO test VALUES('California', 'Waterloo');
97- SELECT * FROM test;
98+ INSERT INTO test VALUES('California', 'Waterloo');
99+ SELECT * FROM test;
98100
99- DELETE FROM test WHERE key='California';
100- SELECT * FROM test;
101+ DELETE FROM test WHERE key='California';
102+ SELECT * FROM test;
101103
102- UPDATE test SET value='VidarSQL';
103- SELECT * FROM test;
104+ UPDATE test SET value='VidarSQL';
105+ SELECT * FROM test;
104106
105- DROP FOREIGN TABLE test;
107+ DROP FOREIGN TABLE test;
106108
107- DROP SERVER kv_server;
108- DROP EXTENSION kv_fdw;
109+ DROP SERVER kv_server;
110+ DROP EXTENSION kv_fdw;
109111
110- \c postgres
111- DROP DATABASE kvtest;
112+ \c postgres
113+ DROP DATABASE kvtest;
112114
113115```
114116
@@ -118,15 +120,15 @@ We have tested certain typical SQL statements and will add more test cases later
118120
119121
120122``` sh
121- sudo service postgresql restart
123+ sudo service postgresql restart
122124
123- cd PostgresForeignDataWrapper
125+ cd PostgresForeignDataWrapper
124126
125- sudo -u postgres psql -U postgres -a -f test/sql/create.sql
127+ sudo -u postgres psql -U postgres -a -f test/sql/create.sql
126128
127- sudo -u postgres psql -U postgres -d kvtest -a -f test/sql/test.sql
129+ sudo -u postgres psql -U postgres -d kvtest -a -f test/sql/test.sql
128130
129- sudo -u postgres psql -U postgres -d kvtest -a -f test/sql/clear.sql
131+ sudo -u postgres psql -U postgres -d kvtest -a -f test/sql/clear.sql
130132```
131133
132134# Debug
@@ -135,7 +137,7 @@ If you want to debug the source code, you may need to start PostgreSQL in the de
135137
136138
137139``` sh
138- sudo service postgresql stop
140+ sudo service postgresql stop
139141
140- sudo -u postgres /usr/lib/postgresql/11/bin/postgres -d 0 -D /var/lib/postgresql/11/main -c config_file=/etc/postgresql/11/main/postgresql.conf
142+ sudo -u postgres /usr/lib/postgresql/11/bin/postgres -d 0 -D /var/lib/postgresql/11/main -c config_file=/etc/postgresql/11/main/postgresql.conf
141143```
0 commit comments