-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1dfebd
commit eea6763
Showing
8 changed files
with
103 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
#!/bin/bash | ||
|
||
# Name of the input file | ||
input_file="daily_closes.sql" | ||
|
||
# Check if the input file exists | ||
if [ ! -f "$input_file" ]; then | ||
echo "Error: $input_file not found!" | ||
exit 1 | ||
fi | ||
|
||
# Counter for INSERT statements | ||
count=0 | ||
|
||
# Counter for output files | ||
file_number=1 | ||
|
||
# Name of the current output file | ||
output_file="daily_closes_${file_number}.sql" | ||
|
||
# Read the input file line by line | ||
while IFS= read -r line | ||
do | ||
# Write the line to the current output file | ||
echo "$line" >> "$output_file" | ||
|
||
# If the line starts with "INSERT INTO", increment the counter | ||
if [[ $line == INSERT\ INTO* ]]; then | ||
((count++)) | ||
fi | ||
|
||
# If we've reached 10 INSERT statements, start a new file | ||
if [ $count -eq 10 ]; then | ||
count=0 | ||
((file_number++)) | ||
output_file="daily_closes_${file_number}.sql" | ||
fi | ||
done < "$input_file" | ||
|
||
echo "Splitting complete. Check the daily_closes_*.sql files." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## @param architecture PostgreSQL architecture (`standalone` or `replication`) | ||
architecture: standalone | ||
primary: | ||
name: primary | ||
resources: | ||
requests: | ||
memory: "4Gi" | ||
limits: | ||
memory: "8Gi" | ||
replication: | ||
## @param replication.synchronousCommit Set synchronous commit mode. Allowed values: `on`, `remote_apply`, `remote_write`, `local` and `off` | ||
## @param replication.numSynchronousReplicas Number of replicas that will have synchronous replication. Note: Cannot be greater than `readReplicas.replicaCount`. | ||
## ref: https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT | ||
## | ||
synchronousCommit: "off" | ||
numSynchronousReplicas: 0 | ||
## @param replication.applicationName Cluster application name. Useful for advanced replication settings | ||
## | ||
applicationName: postgres-jarvis | ||
readReplicas: | ||
name: replica | ||
replicaCount: 0 | ||
auth: | ||
postgresPassword: "postgres" | ||
## @param auth.enablePostgresUser Assign a password to the "postgres" admin user. Otherwise, remote access will be blocked for this user | ||
## | ||
enablePostgresUser: false | ||
## @param auth.replicationUsername Name of the replication user | ||
## | ||
replicationUsername: replica | ||
## @param auth.existingSecret Name of existing secret to use for PostgreSQL credentials. `auth.postgresPassword`, `auth.password`, and `auth.replicationPassword` will be ignored and picked up from this secret. The secret might also contains the key `ldap-password` if LDAP is enabled. `ldap.bind_password` will be ignored and picked from this secret in this case. | ||
## | ||
# existingSecret: postgres-secret | ||
## @param auth.secretKeys.adminPasswordKey Name of key in existing secret to use for PostgreSQL credentials. Only used when `auth.existingSecret` is set. | ||
## @param auth.secretKeys.userPasswordKey Name of key in existing secret to use for PostgreSQL credentials. Only used when `auth.existingSecret` is set. | ||
## @param auth.secretKeys.replicationPasswordKey Name of key in existing secret to use for PostgreSQL credentials. Only used when `auth.existingSecret` is set. | ||
## | ||
# secretKeys: | ||
# adminPasswordKey: postgres-password | ||
# userPasswordKey: password | ||
# replicationPasswordKey: replication-password | ||
postgresql: | ||
postgresqlConfiguration: | ||
work_mem: "64MB" | ||
maintenance_work_mem: "512MB" | ||
effective_cache_size: "8GB" | ||
shared_buffers: "2GB" | ||
metrics: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters