-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflect PostgreSQL UUID functionality part of core since v13.0 #45279
Conversation
@@ -325,8 +325,7 @@ SELECT n.nspname AS enum_schema, | |||
* [pgcrypto generator function](https://www.postgresql.org/docs/current/static/pgcrypto.html) | |||
* [uuid-ossp generator functions](https://www.postgresql.org/docs/current/static/uuid-ossp.html) | |||
|
|||
NOTE: You need to enable the `pgcrypto` (only PostgreSQL >= 9.4) or `uuid-ossp` | |||
extension to use uuid. | |||
NOTE: If you're using PostgresSQL earlier than version 13.0 you may need to enable special extensions to use UUIDs. Enable the `pgcrypto` extension (PostgreSQL >= 9.4) or `uuid-ossp` extension (for even earlier releases). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PostgresSQL
should be PostgreSQL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. :-)
Would you squash your commits? |
@@ -504,7 +503,7 @@ irb> device.id | |||
=> "814865cd-5a1d-4771-9306-4268f188fe9e" | |||
``` | |||
|
|||
NOTE: `gen_random_uuid()` (from `pgcrypto`) is assumed if no `:default` option was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should not be changed because Rails supports PostgreSQL 9.3 or higher. PostgreSQL versions between 9.3 and 12 need pgcrpyto
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the mess, should be good to go now.
This change to the guides reflects that the PostgreSQL function used to generate UUIDs `gen_random_uuid ()` is part of PostgreSQL core beginning with version 13.0. No special extensions are needed for users who want to use UUIDs with PostgreSQL equal or greater version 13.0. See https://www.postgresql.org/docs/current/functions-uuid.html and https://www.postgresql.org/docs/release/13.0/ (look for `gen_random_uuid()` in release notes) for further reference.
Confirmed this document. https://www.postgresql.org/docs/release/13.0/
|
Summary
This change reflects that the SQL function used to generate UUIDs
gen_random_uuid ()
is part of PostgreSQL core beginning with version 13.0. Thus, no special extensions are needed to use UUIDs with PostgreSQL equal or greater version 13.0.Other Information
See https://www.postgresql.org/docs/current/functions-uuid.html, https://www.postgresql.org/docs/release/13.0/ (look for
gen_random_uuid()
in release notes) and https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb#L50 for further reference.