Skip to content

Commit f5e6eab

Browse files
authored
Merge pull request #5 from jsc0218/dev_gc
Dev gc
2 parents 7aadee5 + 369a332 commit f5e6eab

15 files changed

Lines changed: 569 additions & 57 deletions

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,26 @@ We test this foreign data wrapper on Ubuntu Server 18.04 using PostgreSQL-11 tog
5656

5757
sudo make uninstall
5858
```
59-
59+
60+
# Limitations
61+
62+
- The first attribute in the table definition must be the primary key.
63+
64+
- Composite primary key is not supported for now.
65+
6066
# Usage
6167

68+
Before using this foreign data wrapper, you need to add it to ```shared_preload_libraries``` in your ```postgresql.conf```
69+
70+
shared_preload_libraries = 'kv_fdw' # (change requires restart)
71+
72+
and restart Postgres:
73+
74+
75+
```sh
76+
sudo service postgresql restart
77+
```
78+
6279
This extension does not have any parameter. After creating the extension and corresponding server, you can use RocksDB as a foreign storage engine for your PostgreSQL.
6380

6481
A simple example is as follows.

test/expected/basic.out

Lines changed: 0 additions & 40 deletions
This file was deleted.

test/expected/basic.output

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--
2+
-- Test basic select, insert, delete, update operations
3+
--
4+
\c kvtest
5+
You are now connected to database "kvtest" as user "postgres".
6+
CREATE FOREIGN TABLE test(key TEXT, value TEXT) SERVER kv_server;
7+
CREATE FOREIGN TABLE
8+
INSERT INTO test VALUES('YC', 'VidarDB');
9+
INSERT 0 1
10+
SELECT * FROM test;
11+
key | value
12+
-----+---------
13+
YC | VidarDB
14+
(1 row)
15+
16+
INSERT INTO test VALUES('California', 'Waterloo');
17+
INSERT 0 1
18+
SELECT * FROM test;
19+
key | value
20+
------------+----------
21+
YC | VidarDB
22+
California | Waterloo
23+
(2 rows)
24+
25+
DELETE FROM test WHERE key='California';
26+
DELETE 1
27+
SELECT * FROM test;
28+
key | value
29+
-----+---------
30+
YC | VidarDB
31+
(1 row)
32+
33+
UPDATE test SET value='VidarSQL';
34+
UPDATE 1
35+
SELECT * FROM test;
36+
key | value
37+
-----+----------
38+
YC | VidarSQL
39+
(1 row)
40+
41+
DROP FOREIGN TABLE test;
42+
DROP FOREIGN TABLE

test/expected/clear.out

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/expected/clear.output

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--
2+
-- Delete the extension and server
3+
--
4+
\c kvtest
5+
You are now connected to database "kvtest" as user "postgres".
6+
DROP SERVER kv_server;
7+
DROP SERVER
8+
DROP EXTENSION kv_fdw;
9+
DROP EXTENSION
10+
11+
\c postgres
12+
You are now connected to database "postgres" as user "postgres".
13+
DROP DATABASE kvtest;
14+
DROP DATABASE
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
--
22
--Create the extension and server for tests
33
--
4-
CREATE DATABASE kvtest;
4+
CREATE DATABASE kvtest;
55
CREATE DATABASE
6-
\c kvtest
6+
\c kvtest
77
You are now connected to database "kvtest" as user "postgres".
8-
CREATE EXTENSION kv_fdw;
8+
CREATE EXTENSION kv_fdw;
99
CREATE EXTENSION
10-
CREATE SERVER kv_server FOREIGN DATA WRAPPER kv_fdw;
10+
CREATE SERVER kv_server FOREIGN DATA WRAPPER kv_fdw;
1111
CREATE SERVER

0 commit comments

Comments
 (0)