mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Change http postgresql.org links to https [ci skip]
It seems that it accepts only HTTPS connections.
Ref: 7f77cbd996
This commit is contained in:
parent
b5db730769
commit
b52849d421
8 changed files with 32 additions and 32 deletions
|
@ -227,7 +227,7 @@ module ActiveRecord
|
||||||
# You should consult the documentation for your database to understand the
|
# You should consult the documentation for your database to understand the
|
||||||
# semantics of these different levels:
|
# semantics of these different levels:
|
||||||
#
|
#
|
||||||
# * http://www.postgresql.org/docs/current/static/transaction-iso.html
|
# * https://www.postgresql.org/docs/current/static/transaction-iso.html
|
||||||
# * https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html
|
# * https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html
|
||||||
#
|
#
|
||||||
# An ActiveRecord::TransactionIsolationError will be raised if:
|
# An ActiveRecord::TransactionIsolationError will be raised if:
|
||||||
|
|
|
@ -224,7 +224,7 @@ module ActiveRecord
|
||||||
|
|
||||||
# Sets the schema search path to a string of comma-separated schema names.
|
# Sets the schema search path to a string of comma-separated schema names.
|
||||||
# Names beginning with $ have to be quoted (e.g. $user => '$user').
|
# Names beginning with $ have to be quoted (e.g. $user => '$user').
|
||||||
# See: http://www.postgresql.org/docs/current/static/ddl-schemas.html
|
# See: https://www.postgresql.org/docs/current/static/ddl-schemas.html
|
||||||
#
|
#
|
||||||
# This should be not be called manually but set in database.yml.
|
# This should be not be called manually but set in database.yml.
|
||||||
def schema_search_path=(schema_csv)
|
def schema_search_path=(schema_csv)
|
||||||
|
|
|
@ -64,11 +64,11 @@ module ActiveRecord
|
||||||
# defaults to true.
|
# defaults to true.
|
||||||
#
|
#
|
||||||
# Any further options are used as connection parameters to libpq. See
|
# Any further options are used as connection parameters to libpq. See
|
||||||
# http://www.postgresql.org/docs/current/static/libpq-connect.html for the
|
# https://www.postgresql.org/docs/current/static/libpq-connect.html for the
|
||||||
# list of parameters.
|
# list of parameters.
|
||||||
#
|
#
|
||||||
# In addition, default connection parameters of libpq can be set per environment variables.
|
# In addition, default connection parameters of libpq can be set per environment variables.
|
||||||
# See http://www.postgresql.org/docs/current/static/libpq-envars.html .
|
# See https://www.postgresql.org/docs/current/static/libpq-envars.html .
|
||||||
class PostgreSQLAdapter < AbstractAdapter
|
class PostgreSQLAdapter < AbstractAdapter
|
||||||
ADAPTER_NAME = "PostgreSQL".freeze
|
ADAPTER_NAME = "PostgreSQL".freeze
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ module ActiveRecord
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# See http://www.postgresql.org/docs/current/static/errcodes-appendix.html
|
# See https://www.postgresql.org/docs/current/static/errcodes-appendix.html
|
||||||
VALUE_LIMIT_VIOLATION = "22001"
|
VALUE_LIMIT_VIOLATION = "22001"
|
||||||
NUMERIC_VALUE_OUT_OF_RANGE = "22003"
|
NUMERIC_VALUE_OUT_OF_RANGE = "22003"
|
||||||
NOT_NULL_VIOLATION = "23502"
|
NOT_NULL_VIOLATION = "23502"
|
||||||
|
@ -713,7 +713,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
# SET statements from :variables config hash
|
# SET statements from :variables config hash
|
||||||
# http://www.postgresql.org/docs/current/static/sql-set.html
|
# https://www.postgresql.org/docs/current/static/sql-set.html
|
||||||
variables = @config[:variables] || {}
|
variables = @config[:variables] || {}
|
||||||
variables.map do |k, v|
|
variables.map do |k, v|
|
||||||
if v == ":default" || v == :default
|
if v == ":default" || v == :default
|
||||||
|
|
|
@ -315,7 +315,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# See the following:
|
# See the following:
|
||||||
#
|
#
|
||||||
# * http://www.postgresql.org/docs/current/static/transaction-iso.html
|
# * https://www.postgresql.org/docs/current/static/transaction-iso.html
|
||||||
# * https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_er_lock_deadlock
|
# * https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_er_lock_deadlock
|
||||||
class TransactionRollbackError < StatementInvalid
|
class TransactionRollbackError < StatementInvalid
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,7 +54,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Database-specific information on row locking:
|
# Database-specific information on row locking:
|
||||||
# MySQL: http://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html
|
# MySQL: http://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html
|
||||||
# PostgreSQL: http://www.postgresql.org/docs/current/interactive/sql-select.html#SQL-FOR-UPDATE-SHARE
|
# PostgreSQL: https://www.postgresql.org/docs/current/interactive/sql-select.html#SQL-FOR-UPDATE-SHARE
|
||||||
module Pessimistic
|
module Pessimistic
|
||||||
# Obtain a row lock on this record. Reloads the record to obtain the requested
|
# Obtain a row lock on this record. Reloads the record to obtain the requested
|
||||||
# lock. Pass an SQL locking clause to append the end of the SELECT statement
|
# lock. Pass an SQL locking clause to append the end of the SELECT statement
|
||||||
|
|
|
@ -29,8 +29,8 @@ that are supported by the PostgreSQL adapter.
|
||||||
|
|
||||||
### Bytea
|
### Bytea
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-binary.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-binary.html)
|
||||||
* [functions and operators](http://www.postgresql.org/docs/current/static/functions-binarystring.html)
|
* [functions and operators](https://www.postgresql.org/docs/current/static/functions-binarystring.html)
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# db/migrate/20140207133952_create_documents.rb
|
# db/migrate/20140207133952_create_documents.rb
|
||||||
|
@ -49,8 +49,8 @@ Document.create payload: data
|
||||||
|
|
||||||
### Array
|
### Array
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/arrays.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/arrays.html)
|
||||||
* [functions and operators](http://www.postgresql.org/docs/current/static/functions-array.html)
|
* [functions and operators](https://www.postgresql.org/docs/current/static/functions-array.html)
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# db/migrate/20140207133952_create_books.rb
|
# db/migrate/20140207133952_create_books.rb
|
||||||
|
@ -83,8 +83,8 @@ Book.where("array_length(ratings, 1) >= 3")
|
||||||
|
|
||||||
### Hstore
|
### Hstore
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/hstore.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/hstore.html)
|
||||||
* [functions and operators](http://www.postgresql.org/docs/current/static/hstore.html#AEN179902)
|
* [functions and operators](https://www.postgresql.org/docs/current/static/hstore.html#AEN179902)
|
||||||
|
|
||||||
NOTE: You need to enable the `hstore` extension to use hstore.
|
NOTE: You need to enable the `hstore` extension to use hstore.
|
||||||
|
|
||||||
|
@ -116,8 +116,8 @@ Profile.where("settings->'color' = ?", "yellow")
|
||||||
|
|
||||||
### JSON and JSONB
|
### JSON and JSONB
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-json.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-json.html)
|
||||||
* [functions and operators](http://www.postgresql.org/docs/current/static/functions-json.html)
|
* [functions and operators](https://www.postgresql.org/docs/current/static/functions-json.html)
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# db/migrate/20131220144913_create_events.rb
|
# db/migrate/20131220144913_create_events.rb
|
||||||
|
@ -147,8 +147,8 @@ Event.where("payload->>'kind' = ?", "user_renamed")
|
||||||
|
|
||||||
### Range Types
|
### Range Types
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/rangetypes.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/rangetypes.html)
|
||||||
* [functions and operators](http://www.postgresql.org/docs/current/static/functions-range.html)
|
* [functions and operators](https://www.postgresql.org/docs/current/static/functions-range.html)
|
||||||
|
|
||||||
This type is mapped to Ruby [`Range`](http://www.ruby-doc.org/core-2.2.2/Range.html) objects.
|
This type is mapped to Ruby [`Range`](http://www.ruby-doc.org/core-2.2.2/Range.html) objects.
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ event.ends_at # => Thu, 13 Feb 2014
|
||||||
|
|
||||||
### Composite Types
|
### Composite Types
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/rowtypes.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/rowtypes.html)
|
||||||
|
|
||||||
Currently there is no special support for composite types. They are mapped to
|
Currently there is no special support for composite types. They are mapped to
|
||||||
normal text columns:
|
normal text columns:
|
||||||
|
@ -222,7 +222,7 @@ contact.save!
|
||||||
|
|
||||||
### Enumerated Types
|
### Enumerated Types
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-enum.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-enum.html)
|
||||||
|
|
||||||
Currently there is no special support for enumerated types. They are mapped as
|
Currently there is no special support for enumerated types. They are mapped as
|
||||||
normal text columns:
|
normal text columns:
|
||||||
|
@ -260,7 +260,7 @@ article.status = "published"
|
||||||
article.save!
|
article.save!
|
||||||
```
|
```
|
||||||
|
|
||||||
To add a new value before/after existing one you should use [ALTER TYPE](http://www.postgresql.org/docs/current/static/sql-altertype.html):
|
To add a new value before/after existing one you should use [ALTER TYPE](https://www.postgresql.org/docs/current/static/sql-altertype.html):
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# db/migrate/20150720144913_add_new_state_to_articles.rb
|
# db/migrate/20150720144913_add_new_state_to_articles.rb
|
||||||
|
@ -274,7 +274,7 @@ def up
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: ENUM values can't be dropped currently. You can read why [here](http://www.postgresql.org/message-id/29F36C7C98AB09499B1A209D48EAA615B7653DBC8A@mail2a.alliedtesting.com).
|
NOTE: ENUM values can't be dropped currently. You can read why [here](https://www.postgresql.org/message-id/29F36C7C98AB09499B1A209D48EAA615B7653DBC8A@mail2a.alliedtesting.com).
|
||||||
|
|
||||||
Hint: to show all the values of the all enums you have, you should call this query in `bin/rails db` or `psql` console:
|
Hint: to show all the values of the all enums you have, you should call this query in `bin/rails db` or `psql` console:
|
||||||
|
|
||||||
|
@ -289,9 +289,9 @@ SELECT n.nspname AS enum_schema,
|
||||||
|
|
||||||
### UUID
|
### UUID
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-uuid.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-uuid.html)
|
||||||
* [pgcrypto generator function](http://www.postgresql.org/docs/current/static/pgcrypto.html#AEN182570)
|
* [pgcrypto generator function](https://www.postgresql.org/docs/current/static/pgcrypto.html#AEN182570)
|
||||||
* [uuid-ossp generator functions](http://www.postgresql.org/docs/current/static/uuid-ossp.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`
|
NOTE: You need to enable the `pgcrypto` (only PostgreSQL >= 9.4) or `uuid-ossp`
|
||||||
extension to use uuid.
|
extension to use uuid.
|
||||||
|
@ -340,8 +340,8 @@ See [this section](#uuid-primary-keys) for more details on using UUIDs as primar
|
||||||
|
|
||||||
### Bit String Types
|
### Bit String Types
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-bit.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-bit.html)
|
||||||
* [functions and operators](http://www.postgresql.org/docs/current/static/functions-bitstring.html)
|
* [functions and operators](https://www.postgresql.org/docs/current/static/functions-bitstring.html)
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# db/migrate/20131220144913_create_users.rb
|
# db/migrate/20131220144913_create_users.rb
|
||||||
|
@ -364,7 +364,7 @@ user.save!
|
||||||
|
|
||||||
### Network Address Types
|
### Network Address Types
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-net-types.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-net-types.html)
|
||||||
|
|
||||||
The types `inet` and `cidr` are mapped to Ruby
|
The types `inet` and `cidr` are mapped to Ruby
|
||||||
[`IPAddr`](http://www.ruby-doc.org/stdlib-2.2.2/libdoc/ipaddr/rdoc/IPAddr.html)
|
[`IPAddr`](http://www.ruby-doc.org/stdlib-2.2.2/libdoc/ipaddr/rdoc/IPAddr.html)
|
||||||
|
@ -399,7 +399,7 @@ macbook.address
|
||||||
|
|
||||||
### Geometric Types
|
### Geometric Types
|
||||||
|
|
||||||
* [type definition](http://www.postgresql.org/docs/current/static/datatype-geometric.html)
|
* [type definition](https://www.postgresql.org/docs/current/static/datatype-geometric.html)
|
||||||
|
|
||||||
All geometric types, with the exception of `points` are mapped to normal text.
|
All geometric types, with the exception of `points` are mapped to normal text.
|
||||||
A point is casted to an array containing `x` and `y` coordinates.
|
A point is casted to an array containing `x` and `y` coordinates.
|
||||||
|
@ -457,7 +457,7 @@ Document.where("to_tsvector('english', title || ' ' || body) @@ to_tsquery(?)",
|
||||||
Database Views
|
Database Views
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
* [view creation](http://www.postgresql.org/docs/current/static/sql-createview.html)
|
* [view creation](https://www.postgresql.org/docs/current/static/sql-createview.html)
|
||||||
|
|
||||||
Imagine you need to work with a legacy database containing the following table:
|
Imagine you need to work with a legacy database containing the following table:
|
||||||
|
|
||||||
|
|
|
@ -2045,4 +2045,4 @@ following pointers may be helpful:
|
||||||
|
|
||||||
* MariaDB: [EXPLAIN](https://mariadb.com/kb/en/mariadb/explain/)
|
* MariaDB: [EXPLAIN](https://mariadb.com/kb/en/mariadb/explain/)
|
||||||
|
|
||||||
* PostgreSQL: [Using EXPLAIN](http://www.postgresql.org/docs/current/static/using-explain.html)
|
* PostgreSQL: [Using EXPLAIN](https://www.postgresql.org/docs/current/static/using-explain.html)
|
||||||
|
|
|
@ -638,7 +638,7 @@ class Holiday < ApplicationRecord
|
||||||
message: "should happen once per year" }
|
message: "should happen once per year" }
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
Should you wish to create a database constraint to prevent possible violations of a uniqueness validation using the `:scope` option, you must create a unique index on both columns in your database. See [the MySQL manual](http://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html) for more details about multiple column indexes or [the PostgreSQL manual](http://www.postgresql.org/docs/current/static/ddl-constraints.html) for examples of unique constraints that refer to a group of columns.
|
Should you wish to create a database constraint to prevent possible violations of a uniqueness validation using the `:scope` option, you must create a unique index on both columns in your database. See [the MySQL manual](http://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html) for more details about multiple column indexes or [the PostgreSQL manual](https://www.postgresql.org/docs/current/static/ddl-constraints.html) for examples of unique constraints that refer to a group of columns.
|
||||||
|
|
||||||
There is also a `:case_sensitive` option that you can use to define whether the
|
There is also a `:case_sensitive` option that you can use to define whether the
|
||||||
uniqueness constraint will be case sensitive or not. This option defaults to
|
uniqueness constraint will be case sensitive or not. This option defaults to
|
||||||
|
|
Loading…
Reference in a new issue