Skip to content

Commit

Permalink
Merge pull request #49562 from akhilgkrishnan/update-postgres-naming-…
Browse files Browse the repository at this point in the history
…to-postgresql

Update postgres naming to PostgreSQL
  • Loading branch information
carlosantoniodasilva authored and rafaelfranca committed Oct 11, 2023
1 parent 63f204d commit 57d626e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
Expand Up @@ -1398,7 +1398,7 @@ def distinct_relation_for_primary_key(relation) # :nodoc:

limited = relation.reselect(values).distinct!
limited_ids = select_rows(limited.arel, "SQL").map do |results|
results.last(Array(relation.primary_key).length) # ignores order values for MySQL and Postgres
results.last(Array(relation.primary_key).length) # ignores order values for MySQL and PostgreSQL
end

if limited_ids.empty?
Expand Down
Expand Up @@ -15,7 +15,7 @@ def cast_value(value)
time = super
return time if time.is_a?(ActiveSupport::TimeWithZone) || !time.acts_like?(:time)

# While in UTC mode, the PG gem may not return times back in "UTC" even if they were provided to Postgres in UTC.
# While in UTC mode, the PG gem may not return times back in "UTC" even if they were provided to PostgreSQL in UTC.
# We prefer times always in UTC, so here we convert back.
if is_utc?
time.getutc
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -588,7 +588,7 @@ def regroup!(*args) # :nodoc:
# User.order(Arel.sql('end_date - start_date'))
# # SELECT "users".* FROM "users" ORDER BY end_date - start_date
#
# Custom query syntax, like JSON columns for Postgres, is supported in this way.
# Custom query syntax, like JSON columns for PostgreSQL, is supported in this way.
#
# User.order(Arel.sql("payload->>'kind'"))
# # SELECT "users".* FROM "users" ORDER BY payload->>'kind'
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/adapter_prevent_writes_test.rb
Expand Up @@ -54,7 +54,7 @@ def test_errors_when_a_delete_query_is_called_while_preventing_writes
if current_adapter?(:PostgreSQLAdapter)
def test_doesnt_error_when_a_select_query_has_encoding_errors
ActiveRecord::Base.while_preventing_writes do
# Contrary to other adapters, Postgres will eagerly fail on encoding errors.
# Contrary to other adapters, PostgreSQL will eagerly fail on encoding errors.
# But at least we can assert it fails in the client and not before when trying to
# match the query.
assert_raises ActiveRecord::StatementInvalid do
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/calculations_test.rb
Expand Up @@ -1203,7 +1203,7 @@ def test_pluck_functions_with_alias

def test_pluck_functions_without_alias
expected = if current_adapter?(:PostgreSQLAdapter)
# Postgres returns the same name for each column in the given query, so each column is named "coalesce"
# PostgreSQL returns the same name for each column in the given query, so each column is named "coalesce"
# As a result Rails cannot accurately type cast each value.
# To work around this, you should use aliases in your select statement (see test_pluck_functions_with_alias).
[
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/defaults_test.rb
Expand Up @@ -17,7 +17,7 @@ def test_nil_defaults_for_not_null_columns
if current_adapter?(:PostgreSQLAdapter) || current_adapter?(:SQLite3Adapter)
def test_multiline_default_text
record = Default.new
# older postgres versions represent the default with escapes ("\\012" for a newline)
# older PostgreSQL versions represent the default with escapes ("\\012" for a newline)
assert("--- []\n\n" == record.multiline_default || "--- []\\012\\012" == record.multiline_default)
end
end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/query_logs_test.rb
Expand Up @@ -242,7 +242,7 @@ def test_sqlcommenter_format_value_string_coercible
end
end

# Postgres does validate the query encoding. Other adapters don't care.
# PostgreSQL does validate the query encoding. Other adapters don't care.
unless current_adapter?(:PostgreSQLAdapter)
def test_invalid_encoding_query
ActiveRecord::QueryLogs.tags = [ :application ]
Expand Down
2 changes: 1 addition & 1 deletion guides/source/7_1_release_notes.md
Expand Up @@ -684,7 +684,7 @@ Please refer to the [Changelog][active-record] for detailed changes.
```

* Auto generated index names are now limited to 62 bytes, which fits within the default
index name length limits for MySQL, Postgres and SQLite.
index name length limits for MySQL, PostgreSQL and SQLite.

* Introduce adapter for Trilogy database client.

Expand Down
Expand Up @@ -12,13 +12,13 @@ development:
<<: *default
database: <%= app_name %>_development

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# The specified database role being used to connect to PostgreSQL.
# To create additional roles in PostgreSQL see `$ createuser --help`.
# When left blank, PostgreSQL will use the default role. This is
# the same name as the operating system user running Rails.
#username: <%= app_name %>

# The password associated with the postgres role (username).
# The password associated with the PostgreSQL role (username).
#password:

# Connect on a TCP socket. Omitted by default since the client uses a
Expand Down
Expand Up @@ -23,13 +23,13 @@ development:
<<: *default
database: <%= app_name %>_development

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# The specified database role being used to connect to PostgreSQL.
# To create additional roles in PostgreSQL see `$ createuser --help`.
# When left blank, PostgreSQL will use the default role. This is
# the same name as the operating system user running Rails.
#username: <%= app_name %>

# The password associated with the postgres role (username).
# The password associated with the PostgreSQL role (username).
#password:

# Connect on a TCP socket. Omitted by default since the client uses a
Expand Down

0 comments on commit 57d626e

Please sign in to comment.