Skip to content

Commit 5327b8f

Browse files
authored
Fix typos (#499)
Just thought I'd contribute some typo fixes I've stumbled upon. FYI, the top typos are: * publis * rooth * parmeter * paramters * somehing * priviliges * susbcription * privilges * remooving * succeses * conenct * dopped * implicitely * mapas
1 parent a9e6984 commit 5327b8f

24 files changed

+41
-41
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ signs:
4040
- artifacts: checksum
4141
args:
4242
# if you are using this is a GitHub action or some other automated pipeline, you
43-
# need to pass the batch flag to indicate its not interactive.
43+
# need to pass the batch flag to indicate it's not interactive.
4444
- "--batch"
4545
- "--local-user"
4646
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Terraform Provider for PostgreSQL
22
=================================
33

4-
This provider allows to manage with Terraform [Postgresql](https://www.postgresql.org/) objects like databases, extensions, roles, etc..
4+
This provider allows to manage with Terraform [Postgresql](https://www.postgresql.org/) objects like databases, extensions, roles, etc.
55

66
It's published on the [Terraform registry](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs).
77
It replaces https://github.com/hashicorp/terraform-provider-postgresql since Hashicorp stopped hosting community providers in favor of the Terraform registry.

examples/rds/postgresql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#RDS instance
22

3-
This module creates a RDS Postgresql database instance to test the Terraform provider.
3+
This module creates an RDS Postgresql database instance to test the Terraform provider.
44

55
:warning: **This creates a wide publicly accessible database (with a default hardcoded password).**
66
:warning: **This is only for tests purpose and should be destroyed as soon as possible.**

postgresql/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ func (c *Client) Connect() (*DBConnection, error) {
307307

308308
// We don't want to retain connection
309309
// So when we connect on a specific database which might be managed by terraform,
310-
// we don't keep opened connection in case of the db has to be dopped in the plan.
310+
// we don't keep opened connection in case of the db has to be dropped in the plan.
311311
db.SetMaxIdleConns(0)
312312
db.SetMaxOpenConns(c.config.MaxConns)
313313

postgresql/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func withRolesGranted(txn *sql.Tx, roles []string, fn func() error) error {
179179
// in order to manipulate its objects/privileges.
180180
// But PostgreSQL prevents `foo` to be a member of the role `postgres`,
181181
// and for `postgres` to be a member of the role `foo`, at the same time.
182-
// In this case we will temporary revoke this privilege.
182+
// In this case we will temporarily revoke this privilege.
183183
// So, the following queries will happen (in the same transaction):
184184
// - REVOKE postgres FROM foo
185185
// - GRANT foo TO postgres
@@ -294,7 +294,7 @@ func resourcePrivilegesEqual(granted *schema.Set, d *schema.ResourceData) bool {
294294
}
295295

296296
// implicit check: e.g. for object_type schema -> ALL == ["CREATE", "USAGE"]
297-
log.Printf("The wanted privilege is 'ALL'. therefore, we will check if the current privileges are ALL implicitely")
297+
log.Printf("The wanted privilege is 'ALL'. therefore, we will check if the current privileges are ALL implicitly")
298298
implicits := []interface{}{}
299299
for _, p := range allowedPrivileges[objectType] {
300300
if p != "ALL" {

postgresql/helpers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99

1010
func TestFindStringSubmatchMap(t *testing.T) {
1111

12-
resultMap := findStringSubmatchMap(`(?si).*\$(?P<Body>.*)\$.*`, "aa $somehing_to_extract$ bb")
12+
resultMap := findStringSubmatchMap(`(?si).*\$(?P<Body>.*)\$.*`, "aa $something_to_extract$ bb")
1313

1414
assert.Equal(t,
1515
resultMap,
1616
map[string]string{
17-
"Body": "somehing_to_extract",
17+
"Body": "something_to_extract",
1818
},
1919
)
2020
}

postgresql/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func Provider() *schema.Provider {
5454
"database": {
5555
Type: schema.TypeString,
5656
Optional: true,
57-
Description: "The name of the database to connect to in order to conenct to (defaults to `postgres`).",
57+
Description: "The name of the database to connect to in order to connect to (defaults to `postgres`).",
5858
DefaultFunc: schema.EnvDefaultFunc("PGDATABASE", "postgres"),
5959
},
6060
"username": {
@@ -120,7 +120,7 @@ func Provider() *schema.Provider {
120120
Description: "Service account to impersonate when using GCP IAM authentication.",
121121
},
122122

123-
// Conection username can be different than database username with user name mapas (e.g.: in Azure)
123+
// Connection username can be different than database username with user name maps (e.g.: in Azure)
124124
// See https://www.postgresql.org/docs/current/auth-username-maps.html
125125
"database_username": {
126126
Type: schema.TypeString,

postgresql/resource_postgresql_database_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func TestAccPostgresqlDatabase_Update(t *testing.T) {
135135
// Version dependent features values will be set in PreCheck
136136
// because we need to access database to check Postgres version.
137137

138-
// Allow connection depends of Postgres version (needs pg >= 9.5)
138+
// Allow connection depends on Postgres version (needs pg >= 9.5)
139139
var allowConnections bool
140140

141141
resource.Test(t, resource.TestCase{

postgresql/resource_postgresql_default_privileges.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func resourcePostgreSQLDefaultPrivilegesCreate(db *DBConnection, d *schema.Resou
144144
if err := withRolesGranted(txn, []string{owner}, func() error {
145145

146146
// Revoke all privileges before granting otherwise reducing privileges will not work.
147-
// We just have to revoke them in the same transaction so role will not lost his privileges
147+
// We just have to revoke them in the same transaction so role will not lose its privileges
148148
// between revoke and grant.
149149
if err = revokeRoleDefaultPrivileges(txn, d); err != nil {
150150
return err

postgresql/resource_postgresql_default_privileges_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ resource "postgresql_default_privileges" "test_ro" {
195195
})
196196
}
197197

198-
// Test the case where we define default priviliges without specifying a schema. These
199-
// priviliges should apply to newly created resources for the named role in all schema.
198+
// Test the case where we define default privileges without specifying a schema. These
199+
// privileges should apply to newly created resources for the named role in all schema.
200200
func TestAccPostgresqlDefaultPrivileges_NoSchema(t *testing.T) {
201201
skipIfNotAcc(t)
202202

postgresql/resource_postgresql_extension_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestAccPostgresqlExtension_Basic(t *testing.T) {
1414
PreCheck: func() {
1515
testAccPreCheck(t)
1616
testCheckCompatibleVersion(t, featureExtension)
17-
// TODO: Need to check how RDS manage to allow `rds_supuser` to create extension
17+
// TODO: Need to check how RDS manage to allow `rds_superuser` to create extension
1818
// even it's not a real superuser
1919
testSuperuserPreCheck(t)
2020
},

postgresql/resource_postgresql_function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func resourcePostgreSQLFunction() *schema.Resource {
108108
Optional: true,
109109
ForceNew: true,
110110
Default: "plpgsql",
111-
Description: "Language of theof the function. One of: internal, sql, c, plpgsql",
111+
Description: "Language of the function. One of: internal, sql, c, plpgsql",
112112

113113
DiffSuppressFunc: defaultDiffSuppressFunc,
114114
},

postgresql/resource_postgresql_grant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func resourcePostgreSQLGrantCreateOrUpdate(db *DBConnection, d *schema.ResourceD
192192
}
193193
if err := withRolesGranted(txn, owners, func() error {
194194
// Revoke all privileges before granting otherwise reducing privileges will not work.
195-
// We just have to revoke them in the same transaction so the role will not lost its
195+
// We just have to revoke them in the same transaction so the role will not lose its
196196
// privileges between the revoke and grant statements.
197197
if err := revokeRolePrivileges(txn, d, usePrevious); err != nil {
198198
return err

postgresql/resource_postgresql_publication.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
pubTablesAttr = "tables"
2020
pubDropCascadeAttr = "drop_cascade"
2121
pubPublishAttr = "publish_param"
22-
pubPublisViaPartitionRoothAttr = "publish_via_partition_root_param"
22+
pubPublishViaPartitionRootAttr = "publish_via_partition_root_param"
2323
)
2424

2525
func resourcePostgreSQLPublication() *schema.Resource {
@@ -79,7 +79,7 @@ func resourcePostgreSQLPublication() *schema.Resource {
7979
Elem: &schema.Schema{Type: schema.TypeString},
8080
Description: "Sets which DML operations will be published",
8181
},
82-
pubPublisViaPartitionRoothAttr: {
82+
pubPublishViaPartitionRootAttr: {
8383
Type: schema.TypeBool,
8484
Optional: true,
8585
ForceNew: false,
@@ -205,12 +205,12 @@ func setPubParams(txn *sql.Tx, d *schema.ResourceData, pubViaRootEnabled bool) e
205205
paramAlterTemplate := "ALTER PUBLICATION %s %s"
206206
publicationParametersString, err := getPublicationParameters(d, pubViaRootEnabled)
207207
if err != nil {
208-
return fmt.Errorf("Error getting publication paramters: %w", err)
208+
return fmt.Errorf("Error getting publication parameters: %w", err)
209209
}
210210
if publicationParametersString != "" {
211211
sql := fmt.Sprintf(paramAlterTemplate, pubName, publicationParametersString)
212212
if _, err := txn.Exec(sql); err != nil {
213-
return fmt.Errorf("Error updating publication paramters: %w", err)
213+
return fmt.Errorf("Error updating publication parameters: %w", err)
214214
}
215215
}
216216
return nil
@@ -397,7 +397,7 @@ func resourcePostgreSQLPublicationReadImpl(db *DBConnection, d *schema.ResourceD
397397
d.Set(pubAllTablesAttr, puballtables)
398398
d.Set(pubPublishAttr, publishParams)
399399
if sliceContainsStr(columns, "pubviaroot") {
400-
d.Set(pubPublisViaPartitionRoothAttr, pubviaroot)
400+
d.Set(pubPublishViaPartitionRootAttr, pubviaroot)
401401
}
402402
return nil
403403
}
@@ -487,11 +487,11 @@ func validatedPublicationPublishParams(paramList []interface{}) ([]string, error
487487
}
488488

489489
func getPublicationParameters(d *schema.ResourceData, pubViaRootEnabled bool) (string, error) {
490-
parmeterSQLTemplate := ""
490+
parameterSQLTemplate := ""
491491
returnValue := ""
492492
pubParams := make(map[string]string, 2)
493493
if d.IsNewResource() {
494-
if v, ok := d.GetOk(pubPublisViaPartitionRoothAttr); ok {
494+
if v, ok := d.GetOk(pubPublishViaPartitionRootAttr); ok {
495495
if !pubViaRootEnabled {
496496
return "", fmt.Errorf(
497497
"publish_via_partition_root attribute is supported only for postgres version 13 and above",
@@ -508,17 +508,17 @@ func getPublicationParameters(d *schema.ResourceData, pubViaRootEnabled bool) (s
508508
}
509509
}
510510

511-
parmeterSQLTemplate = "WITH (%s)"
511+
parameterSQLTemplate = "WITH (%s)"
512512

513513
} else {
514514

515-
if d.HasChange(pubPublisViaPartitionRoothAttr) {
515+
if d.HasChange(pubPublishViaPartitionRootAttr) {
516516
if !pubViaRootEnabled {
517517
return "", fmt.Errorf(
518518
"publish_via_partition_root attribute is supported only for postgres version 13 and above",
519519
)
520520
}
521-
_, nraw := d.GetChange(pubPublisViaPartitionRoothAttr)
521+
_, nraw := d.GetChange(pubPublishViaPartitionRootAttr)
522522
pubParams["publish_via_partition_root"] = fmt.Sprintf("%v", nraw.(bool))
523523
}
524524

@@ -530,15 +530,15 @@ func getPublicationParameters(d *schema.ResourceData, pubViaRootEnabled bool) (s
530530
pubParams["publish"] = fmt.Sprintf("'%s'", strings.Join(paramsList, ", "))
531531
}
532532
}
533-
parmeterSQLTemplate = "SET (%s)"
533+
parameterSQLTemplate = "SET (%s)"
534534

535535
}
536536
var paramsList []string
537537
for k, v := range pubParams {
538538
paramsList = append(paramsList, fmt.Sprintf("%s = %s", k, v))
539539
}
540540
if len(paramsList) > 0 {
541-
returnValue = fmt.Sprintf(parmeterSQLTemplate, strings.Join(paramsList, ","))
541+
returnValue = fmt.Sprintf(parameterSQLTemplate, strings.Join(paramsList, ","))
542542
}
543543
return returnValue, nil
544544
}

postgresql/resource_postgresql_publication_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ resource "postgresql_publication" "test" {
706706
resource.TestCheckResourceAttr(
707707
"postgresql_publication.test", pubDatabaseAttr, dbName),
708708
resource.TestCheckResourceAttr(
709-
"postgresql_publication.test", pubPublisViaPartitionRoothAttr, "false"),
709+
"postgresql_publication.test", pubPublishViaPartitionRootAttr, "false"),
710710
),
711711
},
712712
{
@@ -724,7 +724,7 @@ resource "postgresql_publication" "test" {
724724
resource.TestCheckResourceAttr(
725725
"postgresql_publication.test", fmt.Sprintf("%s.1", pubPublishAttr), "delete"),
726726
resource.TestCheckResourceAttr(
727-
"postgresql_publication.test", pubPublisViaPartitionRoothAttr, "true"),
727+
"postgresql_publication.test", pubPublishViaPartitionRootAttr, "true"),
728728
),
729729
},
730730
},
@@ -809,7 +809,7 @@ resource "postgresql_publication" "test" {
809809
},
810810
{
811811
Config: testAccPostgresqlPublicationWrongKeys,
812-
ExpectError: regexp.MustCompile("could not update publication tables: Error getting publication paramters: invalid value of `publish_param`: wrong_param. Should be at least one of 'insert, update, delete, truncate'"),
812+
ExpectError: regexp.MustCompile("could not update publication tables: Error getting publication parameters: invalid value of `publish_param`: wrong_param. Should be at least one of 'insert, update, delete, truncate'"),
813813
},
814814
{
815815
Config: testAccPostgresqlPublicationDuplicateKeys,

postgresql/resource_postgresql_role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ func readSearchPath(roleConfig pq.ByteaArray) []string {
499499
return nil
500500
}
501501

502-
// readIdleInTransactionSessionTimeout searches for a idle_in_transaction_session_timeout entry in the rolconfig array.
502+
// readIdleInTransactionSessionTimeout searches for an idle_in_transaction_session_timeout entry in the rolconfig array.
503503
// In case no such value is present, it returns nil.
504504
func readIdleInTransactionSessionTimeout(roleConfig pq.ByteaArray) (int, error) {
505505
for _, v := range roleConfig {

postgresql/resource_postgresql_schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func setSchemaPolicy(txn *sql.Tx, d *schema.ResourceData) error {
509509

510510
// schemaChangedPolicies walks old and new to create a set of queries that can
511511
// be executed to enact each type of state change (roles that have been dropped
512-
// from the policy, added to a policy, have updated privilges, or are
512+
// from the policy, added to a policy, have updated privileges, or are
513513
// unchanged).
514514
func schemaChangedPolicies(old, new []interface{}) (dropped, added, update, unchanged map[string]interface{}) {
515515
type RoleKey string

postgresql/resource_postgresql_schema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestAccPostgresqlSchema_AddPolicy(t *testing.T) {
5656
resource.Test(t, resource.TestCase{
5757
PreCheck: func() {
5858
testAccPreCheck(t)
59-
// TODO: Need to check if remooving policy is buggy
59+
// TODO: Need to check if removing policy is buggy
6060
// because non-superuser fails to drop a role
6161
testSuperuserPreCheck(t)
6262
},

postgresql/resource_postgresql_subscription.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func resourcePostgreSQLSubscriptionCreate(db *DBConnection, d *schema.ResourceDa
8282

8383
optionalParams := getOptionalParameters(d)
8484

85-
// Creating of a subscription can not be done in an transaction
85+
// Creating of a subscription can not be done in a transaction
8686
client := db.client.config.NewClient(databaseName)
8787
conn, err := client.Connect()
8888
if err != nil {

postgresql/utils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func createTestSequences(t *testing.T, dbSuffix string, sequences []string, owne
339339
}
340340

341341
// testHasGrantForQuery executes a query and checks that it fails if
342-
// we were not allowed or succeses if we're allowed.
342+
// we were not allowed or success if we're allowed.
343343
func testHasGrantForQuery(db *sql.DB, query string, allowed bool) error {
344344
_, err := db.Exec(query)
345345
if err != nil {

tests/switch_rds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BEGIN;
1010
CREATE role rds LOGIN CREATEDB CREATEROLE PASSWORD 'rds';
1111
-- On RDS, postgres user is member of these roles
1212
-- But it's not really needed for the tests and pg_monitor is
13-
-- not available on Posgres 8.x
13+
-- not available on Postgres 8.x
1414
-- GRANT pg_monitor,pg_signal_backend TO rds;
1515
ALTER DATABASE postgres OWNER TO rds;
1616
ALTER SCHEMA public OWNER TO rds;

website/docs/index.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ The following arguments are supported:
156156
In this case, some features might be disabled (e.g.: Refreshing state password from database).
157157
* `sslmode` - (Optional) Set the priority for an SSL connection to the server.
158158
Valid values for `sslmode` are (note: `prefer` is not supported by Go's
159-
[`lib/pq`][libpq])):
159+
[`lib/pq`][libpq]):
160160
* disable - No SSL
161161
* require - Always SSL (the default, also skip verification)
162162
* verify-ca - Always SSL (verify that the certificate presented by the server was signed by a trusted CA)

website/docs/r/postgresql_role.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ resource "postgresql_role" "my_replication_role" {
109109
databases and the ROLE is dropped, a
110110
[`REASSIGN OWNED`](https://www.postgresql.org/docs/current/static/sql-reassign-owned.html) in
111111
must be executed on each of the respective databases before the `DROP ROLE`
112-
can be executed to dropped the ROLE from the catalog. This is the first and
112+
can be executed to drop the ROLE from the catalog. This is the first and
113113
second steps taken when removing a ROLE from a database (the second step being
114114
an implicit
115115
[`DROP OWNED`](https://www.postgresql.org/docs/current/static/sql-drop-owned.html)).

website/docs/r/postgresql_subscription.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: "postgresql"
3-
page_title: "PostgreSQL: postgresql_susbcription"
3+
page_title: "PostgreSQL: postgresql_subscription"
44
sidebar_current: "docs-postgresql-resource-postgresql_subscription"
55
description: |-
66
Creates and manages a subscription in a PostgreSQL server database.

0 commit comments

Comments
 (0)