Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/flypg/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewNode() (*Node, error) {
}

// Stub configuration
node.PGConfig = NewConfig(node.DataDir)
node.PGConfig = NewConfig(node.DataDir, node.Port)

// Internal user
node.SUCredentials = Credentials{
Expand Down
5 changes: 4 additions & 1 deletion pkg/flypg/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type PGConfig struct {

internalConfigFilePath string
userConfigFilePath string
port int
dataDir string

internalConfig ConfigMap
Expand Down Expand Up @@ -54,9 +55,10 @@ func (c *PGConfig) UserConfigFile() string {
return c.userConfigFilePath
}

func NewConfig(dataDir string) *PGConfig {
func NewConfig(dataDir string, port int) *PGConfig {
return &PGConfig{
dataDir: dataDir,
port: port,
configFilePath: fmt.Sprintf("%s/postgresql.conf", dataDir),

internalConfigFilePath: fmt.Sprintf("%s/postgresql.internal.conf", dataDir),
Expand Down Expand Up @@ -198,6 +200,7 @@ func (c *PGConfig) SetDefaults() error {

conf := ConfigMap{
"random_page_cost": "1.1",
"port": c.port,
"shared_buffers": fmt.Sprintf("%dMB", sharedBuffersMb),
"max_connections": 300,
"max_replication_slots": 10,
Expand Down