aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant `to_s` in interpolationclaudiob2014-10-302-4/+4
|
* let's warn with heredocsXavier Noria2014-10-281-4/+7
| | | | | | | | | | | | The current style for warning messages without newlines uses concatenation of string literals with manual trailing spaces where needed. Heredocs have better readability, and with `squish` we can still produce a single line. This is a similar use case to the one that motivated defining `strip_heredoc`, heredocs are super clean.
* Fix description of OID in TypeMapInitializerPrathamesh Sonpatki2014-10-251-1/+1
| | | | [ci skip]
* Use #inject over #sum to build PG create DB statementGeoff Harcourt2014-09-171-2/+2
| | | | | | | | | | | | While investigating #16951 I found that another library's monkey-patching of `Enumerable` was causing the test migrations helper to break when trying to build the `CREATE DATABASE` statement. The prior approach used `#sum` to build the string from the options hash. As the code that combines the options to build the database statement is not user-facing, using `#inject` here instead will remove the only place where the database creation/migration code is dependent on ActiveSupport's monkey-patching of `Enumerable`.
* pg, correctly dump foreign keys targeting tables in a different schema.Yves Senn2014-09-171-1/+2
| | | | | | Closes #16907. [Matthew Draper & Yves Senn]
* Move column option handling to new_column_definitionRyuta Kamizono2014-09-031-5/+3
| | | | | TableDefinition#column is not called from `add_column`. Use TableDefinition#new_column_definition for column option handling.
* Avoid using heredoc for user warningsGodfrey Chan2014-08-281-4/+4
| | | | | | | | | | Using heredoc would enforce line wrapping to whatever column width we decided to use in the code, making it difficult for the users to read on some consoles. This does make the source code read slightly worse and a bit more error-prone, but this seems like a fair price to pay since the primary purpose for these messages are for the users to read and the code will not stick around for too long.
* pg, `default_sequence_name` needs to return a string.Yves Senn2014-08-251-2/+2
| | | | | | | | | This is a reacon to https://github.com/rails/rails/commit/d6c1205584b1ba597db4071b168681678b1e9875#commitcomment-7502487 This backwards incompatibility was introduced with d6c12055 to fix #7516. However both `connection.default_sequence_name` and `model.sequence_name` are public API. The PostgreSQL adapter should honor the interface and return strings. /cc @matthewd @chancancode
* CHANGELOG & improvements to #16649Godfrey Chan2014-08-231-2/+2
| | | | | * Require either FIRST or LAST qualifier for "NULLS ..." * Require whitespace before "NULLS ..."
* Don't trim excess whitespace in pg #columns_for_distinctAgis-2014-08-241-1/+2
| | | | Fixes #16623 introduced by https://github.com/rails/rails/commit/3d5a2019bcccc6fb01bee4811ca669f4383edb51
* adding the exception RecordNotFound to UUID findJoseLuis Torres2014-08-211-0/+2
|
* Spelling errorsjbsmith862014-08-141-1/+1
|
* Remove unused text? predicate method and delegationCarlos Antonio da Silva2014-08-051-4/+0
| | | | | | | | The method has been removed in 09206716f8695f6b8467f15c1befa5a4c3c10978 (PR #16074), but the delegation was apparently missed, and one instance of the method was added back with the addition of OID::Xml in 336be2bdf7dfa1b31879d0ab27e5f3101b351923 (PR #16072), so we can safely rm both.
* Add support for Postgresql JSONBPhilippe Creux2014-07-243-0/+28
| | | | [Philippe Creux, Chris Teague]
* pg, `change_column_default, :table, :column, nil` issues `DROP DEFAULT`.Yves Senn2014-07-241-1/+9
| | | | | | | | | | | | Closes #16261. [Matthew Draper, Yves Senn] Using `DEFAULT NULL` results in the same behavior as `DROP DEFAULT`. However, PostgreSQL will cast the default to the columns type, which leaves us with a default like "default NULL::character varying". /cc @matthewd
* Treat invalid uuid as nilAbdelkader Boudih2014-07-141-1/+10
|
* Don't rely on the column SQL type for bit string quotingSean Griffin2014-07-112-13/+33
|
* Merge pull request #16071 from sgrif/sg-pg-type-castRafael Mendonça França2014-07-081-15/+0
|\ | | | | Remove PG's definition of `type_cast`
| * Remove PG's definition of `type_cast`Sean Griffin2014-07-061-15/+0
| | | | | | | | | | All cases except for `nil` in an array have been removed. `nil` in an array is handled by the Array type object.
* | Merge pull request #16072 from sgrif/sg-xml-quotingRafael Mendonça França2014-07-083-3/+41
|\ \ | | | | | | Don't rely on the sql type to quote XML columns in PG
| * | Don't rely on the sql type to quote XML columns in PGSean Griffin2014-07-063-3/+41
| |/
* / Remove the `text?` predicate from the type objectsSean Griffin2014-07-061-4/+0
|/ | | | | | | This was only used for uniqueness validations. The first usage was in conjunction with `limit`. Types which cast to string, but are not considered text cannot have a limit. The second case was only with an explicit `:case_sensitive => true` option given by the user.
* Use the type object for quoting PG RangesSean Griffin2014-07-054-48/+34
|
* Merge pull request #16037 from sgrif/sg-money-quotingRafael Mendonça França2014-07-041-7/+0
|\ | | | | Remove unneccessary special case for money in quoting
| * Remove unneccessary special case for money in quotingSean Griffin2014-07-031-7/+0
| |
* | Merge pull request #16036 from sgrif/sg-datetime-infinityRafael Mendonça França2014-07-032-3/+2
|\ \ | | | | | | Do not rely on the column type when quoting infinity
| * | Do not rely on the column type when quoting infinitySean Griffin2014-07-032-3/+2
| |/
* / Use the type object for type casting HStore columnsSean Griffin2014-07-033-55/+34
|/
* Quote range strings when quoting PG rangesSean Griffin2014-07-021-1/+1
| | | | | The test case for CVE-2014-3483 doesn't actually send the generated SQL to the database. The generated SQL is actually invalid for real inputs.
* Fix SQL injection when querying against ranges and bitstringsRafael Mendonça França2014-07-021-3/+4
| | | | Fix CVE-2014-3483 and protect against CVE-2014-3482.
* Merge pull request #15977 from sgrif/sg-remove-array-hackGodfrey Chan2014-06-291-24/+0
|\ | | | | Remove array workaround in PG quoting
| * Remove array workaround in PG quotingSean Griffin2014-06-291-24/+0
| | | | | | | | | | We no longer need to do fancy legwork to make sure arrays use a type object, now that schema methods use a real type object.
* | Remove unused `array_member` from PG quoting for HStore columnsSean Griffin2014-06-292-12/+9
|/ | | | | Hstore no longer needs additional quoting to be used in an array, the array type handles it sufficiently.
* Use the type object when sending point columns to the DBSean Griffin2014-06-293-19/+9
|
* Use the type object for sending JSON to the databaseSean Griffin2014-06-293-22/+10
|
* Always pass a column with a type object to quoteSean Griffin2014-06-281-0/+8
| | | | | | | | The only case where we got a column that was not `nil`, but did not respond to `cast_type` was when type casting the default value during schema creation. We can look up the cast type, and add that object to the column definition. Will allow us to consistently rely on the type objects for type casting in all directions.
* rename sequence only if it existsAbdelkader Boudih2014-06-271-3/+3
|
* fk: review corrections: indent, visibility, syntax, wording.Yves Senn2014-06-261-12/+12
|
* fk: support for on_updateYves Senn2014-06-261-7/+12
|
* fk: rename `dependent` to `on_delete`Yves Senn2014-06-261-2/+2
|
* fk: support dependent option (:delete, :nullify and :restrict).Yves Senn2014-06-261-1/+8
|
* fk: generalize using `AlterTable` and `SchemaCreation`.Yves Senn2014-06-261-20/+0
|
* fk: `foreign_keys`, `add_foreign_key` and `remove_foreign_key` for MySQLYves Senn2014-06-262-21/+0
|
* fk: add `foreign_keys` for PostgreSQL adapter.Yves Senn2014-06-262-0/+38
|
* fk: `add_foreign_key` and `remove_foreign_key` for PostgreSQL adapter.Yves Senn2014-06-261-0/+27
|
* add missing `:nodoc:` for recent refactorings. [ci skip]Yves Senn2014-06-2423-23/+23
| | | | | | | | | | Adding `# :nodoc:` to the parent `class` / `module` is not going to ignore nested classes or modules. There is a modifier `# :nodoc: all` but sadly the containing class or module will continue to be in the docs. /cc @sgrif
* Don't use column object for type casting in `quoting`Sean Griffin2014-06-181-2/+2
| | | | | | | | | We're never going to be able to use the attribute object here, however, so let's just accept the ugly demeter violation here for now. Remove test cases which were either redundant with other tests in the file, or were actually testing the type objects (which are tested elsewhere)
* Detect in-place changes on point typesSean Griffin2014-06-172-3/+20
|
* Detect mutations of arrays and array membersSean Griffin2014-06-171-12/+14
|
* Ensure `OID::Array#type_cast_for_database` matches PG's quoting behaviorSean Griffin2014-06-172-7/+21
| | | | | | Also takes a step towards supporting types which use a character other than ',' for the delimiter (`box` is the only built in type for which this is the case)