Skip to content

Commit

Permalink
Replace table config with view for postgresql.conf
Browse files Browse the repository at this point in the history
fixes #21
  • Loading branch information
redrick committed Mar 27, 2017
1 parent 1290d7c commit 6841111
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,38 @@ To update to the latest version, run the following command after running "make i

ALTER EXTENSION amqp UPDATE;

Setup
-----

Once you are all set, you can enter your credentials to `postgresql.conf`

This file is under you local postgres installation, e.g. ubuntu PostgreSQL 9.6
location may be: `/etc/postgresql/9.6/main/postgresql.conf`

format of the data is as follows:

```
amqp.broker = '[{ "broker_id": 1, "host": "px8.uol.cz", "port": "5670",
"vhost": "", "username": "expert", "password": "expert" }]'
```

This way you can enter how many configurations you want dividing your broker
configuration with comma like this:

```
amqp.broker = '[{ "broker_id": 1, "host": "host.cz", "port": "5672",
"vhost": "/", "username": "username", "password": "password" },
{ "broker_id": 2, "host": "host.cz", "port": "5672",
"vhost": "/", "username": "username", "password": "password" }]'
```

After changes in postgresql.conf you have to restart postgresql service, on
ubunutu look like this:

```
service postgresql restart
```

Basic Usage
-----------

Expand Down
11 changes: 0 additions & 11 deletions sql/tables/tables.sql

This file was deleted.

3 changes: 3 additions & 0 deletions sql/views/views.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE OR REPLACE VIEW @extschema@.broker AS
select * from json_to_recordset(current_setting('amqp.broker')::json)
as x(broker_id int, host text, port int, vhost text, username text, password text);

0 comments on commit 6841111

Please sign in to comment.