aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* activerecord: Fix identity for sum of strings3-2-stable-for-hmnoHarald Eilertsen2019-08-061-1/+1
|
* Check against bit string values using multiline regexpRafael Mendonça França2014-07-021-3/+3
| | | | Fix CVE-2014-3482.
* Do not shallow the original exception in exec_cacheRafael Mendonça França2013-07-091-1/+5
| | | | | | | when result_error_field is not defined on result raise the original exception. Fixes #11260
* Correctly parse bigint defaults in PostgreSQL, Backpost #10098.Erik Peterson2013-04-111-1/+1
| | | | | | | | Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb activerecord/test/cases/schema_dumper_test.rb
* Wrong exception is occured when raising no translatable exceptionkennyj2013-03-201-0/+2
| | | | | Conflicts: activerecord/CHANGELOG.md
* Don't crash exception translation w/ nil result attribute.Steve Jorgensen2013-03-201-1/+1
| | | | | | Exception.result is nil when attempting a query after PostgreSQL disconnect, resulting in new exception: NoMethodError: undefined method `error_field' for nil:NilClass
* connection_parameters is an Array and will never haveRafael Mendonça França2013-01-061-2/+0
| | | | prepared_statements as value
* Merge pull request #8417 from kennyj/fix_8414Rafael Mendonça França2012-12-041-3/+2
| | | | | | Fix #8414. Performance problem with postgresql adapter primary_key function. Conflicts: activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* Merge pull request #6397 from kennyj/fix_translate_exceptionAaron Patterson2012-11-301-3/+7
| | | | Fix a problem of translate_exception method in a Japanese (non English) environment.
* Merge pull request #8276 from pwnall/pgsql_text_limitsRafael Mendonça França2012-11-201-0/+7
| | | | | | | Postgresql doesn't accepts limits on text columns Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* 7914 Using a better way to get the defaults from db.Arturo Pie2012-10-141-12/+7
| | | | | | | | | | | | | | | | Changes: * According to postgreSQL documentation: (http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html) we should not be using 'adsrc' field because this field is unaware of outside changes that could affect the way that default values are represented. Thus, I changed the queries to use "pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field. * Remove parsing of character type default values for 8.1 formatting since Rails doesn't support postgreSQL 8.1 anymore. * Remove misleading comment unrelated to code.
* #7914 get default value when type uses schema nameArturo Pie2012-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL adapter properly parses default values when using multiple schemas and domains. When using domains across schemas, PostgresSQL prefixes the type of the default value with the name of the schema where that type (or domain) is. For example, this query: ``` SELECT a.attname, d.adsrc FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = "defaults"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum; ``` could return something like "'<default_value>'::pg_catalog.text" or "(''<default_value>'::pg_catalog.text)::text" for the text columns with defaults. I modified the regexp used to parse this value so that it ignores anything between ':: and \b(?:character varying|bpchar|text), and it allows to have optional parens like in the above second example.
* Merge pull request #7850 from ↵Rafael Mendonça França2012-10-061-1/+1
| | | | | | | | | senny/5920_postgres_adapter_table_with_capital_letters postgres, quote table names when fetching the primary key (#5920) Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* Backport explain fixes.Rafael Mendonça França2012-09-161-9/+9
| | | | | | | | * Mark as SCHEMA some schema database queries. #7648 * Don't explain queries except normal CRUD sql. #7657 Closes #6458 Closes #7544
* Backport PostgreSQL auto-reconnect test coverageSteve Jorgensen2012-09-131-0/+1
| | | | | | | | | | | | | | | | 6d5f4de4c420ebb906109668f5702a537ac77692 Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests. 4b1bca04025a66c54e6e9d5eb6e4d4056bfa92f0 Stop being silly with formatting of method aliasing. c381d5cbf959208adeb38e7859ee815dfbd2cf54 Fix just-plain-wrongness of psql auto-reconnect test. 1e17a9d367c54c680368be72f44247ae28b98904 Fix only-once stub logic. f16c2043826ec1991cf94fe17cb671507b7a7f51 Changelog for PostgreSQL auto-reconnect test coverage backport.
* Merge pull request #5872 from evtuhovich/prepared_statement_fixAaron Patterson2012-08-061-10/+10
| | | | | | Remove prepared statement from system query in postgresql adapter Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
* Backport #5168 to 3-2-stable. Fix a problem that NULLS is ignored by ↵kennyj2012-08-021-1/+1
| | | | postgresql_adapter.rb while creating distincts.
* Update psql adapter to rename a default pkey sequence during rename_table.Robb Kidd2012-07-101-0/+7
|
* Merge pull request #6477 from steveklabnik/close_discovered_pg_connectionRafael Mendonça França2012-05-301-1/+2
| | | | Properly discover a connection is closed in postgresql_adapter
* Postgresql doesn't accept limits on binary (bytea) columns.Victor Costan2012-05-211-8/+19
|
* Merge pull request #5437 from kennyj/fix_5430Aaron Patterson2012-03-151-1/+1
| | | | Fix GH #5430. A Payload name for schema_search_path should be SCHEMA.
* prepared statements can be disabledAaron Patterson2012-02-211-2/+15
|
* tag bind params with a bind param objectAaron Patterson2012-02-211-1/+1
|
* Merge pull request #5096 from lawso017/masterAaron Patterson2012-02-211-16/+36
| | | | Restoring ability to derive id/sequence from tables with nonstandard sequences for primary keys
* implements automatic EXPLAIN logging for slow queriesXavier Noria2011-12-021-2/+7
|
* Revert "Use any instead of length"José Valim2011-11-281-1/+1
| | | | This reverts commit 1756629835d39f60ef4c96aff81ac503c71b98b7.
* Use any instead of lengthRahul P. Chaudhari2011-11-271-1/+1
|
* removing deprecated methodsAaron Patterson2011-11-191-4/+0
|
* adding visitors to the respective adaptersAaron Patterson2011-11-191-0/+1
|
* Merge pull request #3521 from ↵Aaron Patterson2011-11-061-2/+1
| | | | | | nulogy/fix_postgres_adapter_to_handle_spaces_between_schemas Fix postgres adapter to handle spaces between schemas
* implements AR::Relation#explainXavier Noria2011-11-051-1/+43
| | | | | | | | | | | | | | | | | | | This is a first implementation, EXPLAIN is highly dependent on the database and I have made some compromises. On one hand, the method allows you to run the most common EXPLAIN and that's it. If you want EXPLAIN ANALYZE in PostgreSQL you need to do it by hand. On the other hand, I've tried to construct a string as close as possible to the ones built by the respective shells. The rationale is that IMO the user should feel at home with the output and recognize it at first sight. Per database. I don't know whether this implementation is going to work well. Let's see whether people like it.
* AR changes to support creating ordered (asc, desc) indexesVlad Jebelev2011-11-041-3/+13
|
* clear statement cache when tables are alteredAaron Patterson2011-10-271-0/+6
|
* Merge pull request #3258 from ileitch/3-1-stableAaron Patterson2011-10-201-1/+7
| | | | Postgres: Do not attempt to deallocate a statement if the connection is no longer active.
* reset prepared statement when schema changes imapact statement results. ↵Aaron Patterson2011-10-181-11/+43
| | | | fixes #3335
* Use the schema_search_path in prepared statements.Juan M. Cuello2011-10-051-3/+4
| | | | | To allow the use of prepared statements when changing schemas in postgres, the schema search path is added to the sql key.
* LRU should cache per process in postgresql. fixes #1339Aaron Patterson2011-09-071-10/+14
|
* fixing view queriesAaron Patterson2011-09-071-3/+5
|
* use the supplied bind valuesAaron Patterson2011-09-071-1/+1
|
* Merge commit 'refs/pull/2909/head' of https://github.com/rails/rails into rawrAaron Patterson2011-09-071-6/+4
| | | | | | * https://github.com/rails/rails: Postgresql adapter: added current_schema check for table_exists? Postgresql adapter: added current_schema check for table_exists?
* Database adapters use a statement pool.Aaron Patterson2011-09-061-5/+41
| | | | | | Database adapters use a statement pool for limiting the number of open prepared statments on the database. The limit defaults to 1000, but can be adjusted in your database config by changing 'statement_limit'.
* Merge pull request #2021 from dasch/more_postgres_utilsAaron Patterson2011-08-291-1/+3
|\ | | | | Make #extract_schema_and_table an instance method in Utils
| * Make #extract_schema_and_table an instance method in UtilsDaniel Schierbeck2011-07-091-1/+3
| | | | | | | | Also, move the utils test into its own test case.
* | Make it the responsibility of the connection to hold onto an ARel visitor ↵Jon Leighton2011-08-081-0/+4
| | | | | | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
* | accept option for recreate db for postgres (same as mysql now)artemk2011-08-041-2/+4
|/
* Refactor PostgreSQLAdapter a bitDaniel Schierbeck2011-07-081-16/+18
| | | | | Move the private method #extract_schema_and_table into a separate Utils module so that it can be tested without resorting to #send.
* Improve ordering of multiple columns on postgresqlLucia Escanellas2011-06-241-1/+1
| | | | | * Only on postgresql, order("first asc, second asc") was invalid * Closes #1720
* Merge remote branch 'rails/master' into pg_schema_fuPaul Gallagher2011-06-191-2/+2
|\
| * Remove trailing whitespacesGuillermo Iguaran2011-06-121-2/+2
| |
* | Make PostgreSQL adapter view-compatiblePaul Gallagher2011-06-191-3/+5
| | | | | | * amongst other things, allows meta_search to run against view-backed models