aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* test to ensure bad prepared statements raise a StatementInvalid exceptionAaron Patterson2014-01-171-0/+6
|
* no need to `return skip` in tests. `skip` is enough.Yves Senn2014-01-163-3/+3
|
* Make change_table use object of current database adapterNishant Modak2014-01-071-0/+17
| | | | | | | | | - Earlier, change_table was creating database-agnostic object. - After this change, it will create correct object based on current database adapter. - This will ensure that create_table and change_table will get same objects. - This makes update_table_definition method public and nodoc. - Fixes #13577 and #13503
* used user-defined configurations for running tests that might depend on ↵Kuldeep Aggarwal2013-12-291-1/+2
| | | | user's system configuration
* Tidy up fix for PG extensions quotingCarlos Antonio da Silva2013-12-233-6/+18
| | | | | Always pass in the column for quote_bound_value and quote using it in case it exists there.
* Serialize postgres' hstore, json and array types correctly in AR update methods.Tadas Tamosauskas2013-12-233-0/+18
| | | | | | | | | Fixes #12261. Closes #12395. Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/adapters/postgresql/array_test.rb activerecord/test/cases/adapters/postgresql/json_test.rb
* Do not consider PG array columns as number or text columnsCarlos Antonio da Silva2013-12-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | The code uses these checks in several places to know what to do with a particular column, for instance AR attribute query methods has a branch like this: if column.number? !value.zero? end This should never be true for array columns, since it would be the same as running [].zero?, which results in a NoMethodError exception. Fixing this by ensuring that array columns in PostgreSQL never return true for number?/text? checks. Since most of the array support was based on the postgres_ext lib, it's worth noting it does the same thing for numeric array columns too: https://github.com/dockyard/postgres_ext/blob/v1.0.0/lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb#L72 This extended the same logic for text columns to ensure consistency.
* Tell how to Create a Database in Error Messageschneems2013-12-231-0/+7
| | | | | | | | | | | | | | | | Currently if you attempt to use a database that does not exist you get an error: ``` PG::ConnectionBad FATAL: database "db_error" does not exist ``` The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message: ``` ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist Run `$ bin/rake db:create db:migrate` to create your database ``` Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
* fix quoting non-stringsDamien Mathieu2013-12-221-0/+6
| | | | Closes #13444
* Fix indent in PG array testsCarlos Antonio da Silva2013-12-191-5/+5
| | | | [ci skip]
* Merge pull request #13395 from kuldeepaggarwal/postgres-table-ref-regexCarlos Antonio da Silva2013-12-191-0/+12
|\ | | | | modified regex for finding table_name from a multiline sql query in postgresql
| * Fix PostgreSQL insert to properly extract table name from multiline string SQL.Kuldeep Aggarwal2013-12-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Previously, executing an insert SQL in PostgreSQL with a command like this: insert into articles( number) values( 5152 ) would not work because the adapter was unable to extract the correct articles table name.
* | Fix PostgreSQL range testsMatthew Draper2013-12-191-11/+11
|/ | | | The changes in c4044b2 meant the tests would error on a fresh DB.
* refactor, reuse assertions in range_test.rb.Yves Senn2013-12-131-186/+111
|
* extract PG range tests from datatype_test.rb into range_test.rbYves Senn2013-12-132-282/+320
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-086-420/+401
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* short arrays in inspectJan Bernacki2013-10-301-0/+5
|
* Merge pull request #12643 from severin/pg_cast_json_on_writeYves Senn2013-10-251-0/+7
|\ | | | | cast json values on write to be consistent with reading from the db.
| * cast json values on write to be consistent with reading from the db.Severin Schoepke2013-10-251-0/+7
| | | | | | | | See also commit 5ac2341fab689344991b2a4817bd2bc8b3edac9d
* | Merge pull request #12633 from senny/no_more_time_zone_leaksYves Senn2013-10-251-25/+15
|\ \ | |/ |/| prevent global timezone state from leaking out of test cases.
| * prevent global timezone state from leaking out of test cases.Yves Senn2013-10-251-25/+15
| |
* | `ActiveRecord::Store` works together with PG `hstore` columns.Yves Senn2013-10-251-0/+21
| | | | | | | | | | | | This is necessary because as of 5ac2341 `hstore` columns are always stored as `Hash` with `String` keys. `ActiveRecord::Store` expected the attribute to be an instance of `HashWithIndifferentAccess`, which led to the bug.
* | test to verify the `ActiveRecord::Store` behavior with PG's json typeYves Senn2013-10-251-0/+18
|/
* Dump the default function when the primary key is uuidRafael Mendonça França2013-10-141-2/+2
| | | | Fixes #12489
* log the statement name along with the SQLAaron Patterson2013-10-041-0/+10
|
* stop adding singleton methods to the mysql2 adapterAaron Patterson2013-10-041-15/+0
|
* stop adding singleton methods to the PG connectionAaron Patterson2013-10-041-11/+26
|
* Merge pull request #12315 from gaurish/superRafael Mendonça França2013-09-231-26/+28
|\ | | | | TypeError: superclass mismatch for class PostgreSQLAdapter
| * We shouldn't override PostgreSQLAdapter's superclass inheritance while ↵Gaurish Sharma2013-09-231-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | monkeypatching Changing Inheritance section leads to following error on JRuby TypeError: superclass mismatch for class PostgreSQLAdapter After this change, Jruby: The above error no longer appear. Tests are still failing but they do run. Progress! MRI: No change, all green(tested by running take test_test_postgresql) Thanks to Aditya Sanghi(@asanghi) for help
* | Merge pull request #11382 from kennyj/fix_10751-2Rafael Mendonça França2013-09-221-0/+1
|\ \ | | | | | | | | | | | | | | | | | | Dump UUID default functions to schema.rb [2nd version]. Fixes #10751. Conflicts: activerecord/CHANGELOG.md
| * | Migration dump UUID default functions to schema.rb. Fixes #10751.kennyj2013-07-101-0/+1
| | |
* | | Merge pull request #10500 from kennyj/fix_10450Rafael Mendonça França2013-09-221-0/+40
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Fixed a bug in when using has_many association with :inverse_of option and UUID primary key. Conflicts: activerecord/CHANGELOG.md
| * | Fixed a bug in when using has_many association with :inverse_of option and ↵kennyj2013-05-081-0/+40
| | | | | | | | | | | | UUID primary key.
* | | Test that PostgreSQL adapter includes `usec` when quoting `DateTime`Ben Cherry2013-08-281-0/+5
| | |
* | | PG adapter deals with negative money values formatted with parenthesis.Yves Senn2013-08-261-0/+8
| | | | | | | | | | | | Closes #11899.
* | | Stop interpreting SQL 'string' columns as :string type.Ben Woosley2013-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | SQL doesn't have a string type, and interpreting 'string' as text is contrary to at least SQLite3's behavior: "Note that a declared type of 'STRING' has an affinity of NUMERIC, not TEXT." http://www.sqlite.org/datatype3.html
* | | Merge pull request #11574 from jetthoughts/11552_rescue_on_invalid_inet_assignYves Senn2013-08-141-0/+14
|\ \ \ | | | | | | | | Fix assign ip address with invalid values raise exception
| * | | Rescue invalid ip address exceptions on assign.Paul Nikitochkin2013-08-141-0/+14
| | | | | | | | | | | | | | | | In order that set attribute should not be bang method
* | | | Removed redundant asserts for assigns attribute operationPaul Nikitochkin2013-08-141-28/+28
|/ / /
* | | using assert_not instead of refuteRajarshi Das2013-08-131-3/+3
| | |
* | | cast hstore values on write to be consistent with reading from the db.Yves Senn2013-08-081-0/+7
| | |
* | | Fix multidimensional PG arrays containing non-string itemsYves Senn2013-08-071-14/+19
| | |
* | | test to express that we can't turn non-array columns to array columns.Yves Senn2013-08-061-0/+9
| | | | | | | | | | | | Closes #11062
* | | fix for postgresql failing test in localKarunakar (Ruby)2013-08-041-1/+1
| | |
* | | Use assert_nil instead of testing for equalityCarlos Antonio da Silva2013-08-021-2/+1
| | |
* | | Removed redundant xml override from pg adapterPaul Nikitochkin2013-08-021-0/+39
| | | | | | | | | | | | Closes: #11706
* | | `change_column` for PG adapter respects `:array` option.Yves Senn2013-07-161-0/+12
| |/ |/|
* | Remove deprecated SchemaStatements#distinctFrancesco Rodriguez2013-07-021-46/+0
| |
* | Add CHANGELOG enty for #11235Rafael Mendonça França2013-07-021-1/+0
| |
* | the typecast value should be passed to the serializer. fixes #10830Aaron Patterson2013-06-051-1/+0
| |