https://github.com/its-alex/postgres-fdw-example
Example of postgres_fdw plugins with docker
https://github.com/its-alex/postgres-fdw-example
docker example postgres postgres-fdw
Last synced: 11 months ago
JSON representation
Example of postgres_fdw plugins with docker
- Host: GitHub
- URL: https://github.com/its-alex/postgres-fdw-example
- Owner: Its-Alex
- License: mit
- Created: 2018-11-13T15:46:03.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T15:57:35.000Z (about 7 years ago)
- Last Synced: 2025-02-23T11:12:29.717Z (11 months ago)
- Topics: docker, example, postgres, postgres-fdw
- Language: Dockerfile
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postgres_fdw example
Example of postgres_fdw plugins with docker
## Demo
You can start all databases
```
$ make up
```
and stop
```
$ make down
```
There are 3 databases with on master `postgres-1` and two slaves. Just one main
table `temperatures`, with partitionning on `at`.
Each temperatures in 2016 will be stored in postgres-2 and all temperatures in
2017 will be stored in postgres-3.
```
$ make enter-master
poc-sharding=# INSERT INTO temperatures (at, city, mintemp, maxtemp) VALUES ('2016-08-03', 'London', 63, 73);
INSERT 0 1
poc-sharding=# select * from temperatures;
at | city | mintemp | maxtemp
------------+--------+---------+---------
2016-08-03 | London | 63 | 73
(1 row)
poc-sharding=# select * from temperatures_2016;
at | city | mintemp | maxtemp
------------+--------+---------+---------
2016-08-03 | London | 63 | 73
(1 row)
poc-sharding=# select * from temperatures_2017;
at | city | mintemp | maxtemp
------------+--------+---------+---------
(0 row)
```
## Configuration
All postgres setup all in migrations and are sorted by containers names. You can
update some setup by editing files inside this folder.
## License
[MIT](https://en.wikipedia.org/wiki/MIT_License)