Skip to content

Commit fa26773

Browse files
authored
Fix docker-compose (#193)
Fix docker-compose local build
1 parent dea952e commit fa26773

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For quick local example, use the Docker Compose environment provided:
3636
docker-compose up
3737

3838
# In a new terminal:
39-
psql -h 127.0.0.1 -p 6432 -c 'SELECT 1'
39+
PGPASSWORD=postgres psql -h 127.0.0.1 -p 6432 -U postgres -c 'SELECT 1'
4040
```
4141

4242
### Config

examples/docker/pgcat.toml

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ admin_password = "postgres"
4848
# configs are structured as pool.<pool_name>
4949
# the pool_name is what clients use as database name when connecting
5050
# For the example below a client can connect using "postgres://sharding_user:sharding_user@pgcat_host:pgcat_port/sharded"
51-
[pools.sharded]
51+
[pools.postgres]
5252
# Pool mode (see PgBouncer docs for more).
5353
# session: one server connection per connected client
5454
# transaction: one server connection per client transaction
@@ -84,7 +84,7 @@ primary_reads_enabled = true
8484
sharding_function = "pg_bigint_hash"
8585

8686
# Credentials for users that may connect to this cluster
87-
[pools.sharded.users.0]
87+
[pools.postgres.users.0]
8888
username = "postgres"
8989
password = "postgres"
9090
# Maximum number of server connections that can be established for this user
@@ -95,14 +95,8 @@ pool_size = 9
9595
# Maximum query duration. Dangerous, but protects against DBs that died in a non-obvious way.
9696
statement_timeout = 0
9797

98-
[pools.sharded.users.1]
99-
username = "postgres"
100-
password = "postgres"
101-
pool_size = 21
102-
statement_timeout = 15000
103-
10498
# Shard 0
105-
[pools.sharded.shards.0]
99+
[pools.postgres.shards.0]
106100
# [ host, port, role ]
107101
servers = [
108102
[ "postgres", 5432, "primary" ],
@@ -111,37 +105,16 @@ servers = [
111105
# Database name (e.g. "postgres")
112106
database = "postgres"
113107

114-
[pools.sharded.shards.1]
108+
[pools.postgres.shards.1]
115109
servers = [
116110
[ "postgres", 5432, "primary" ],
117111
[ "postgres", 5432, "replica" ],
118112
]
119113
database = "postgres"
120114

121-
[pools.sharded.shards.2]
115+
[pools.postgres.shards.2]
122116
servers = [
123117
[ "postgres", 5432, "primary" ],
124118
[ "postgres", 5432, "replica" ],
125119
]
126120
database = "postgres"
127-
128-
129-
[pools.simple_db]
130-
pool_mode = "session"
131-
default_role = "primary"
132-
query_parser_enabled = true
133-
primary_reads_enabled = true
134-
sharding_function = "pg_bigint_hash"
135-
136-
[pools.simple_db.users.0]
137-
username = "postgres"
138-
password = "postgres"
139-
pool_size = 5
140-
statement_timeout = 0
141-
142-
[pools.simple_db.shards.0]
143-
servers = [
144-
[ "postgres", 5432, "primary" ],
145-
[ "postgres", 5432, "replica" ]
146-
]
147-
database = "postgres"

0 commit comments

Comments
 (0)