aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* pg, re-introduce `PostgreSQL::Utils` to unify schema/table extraction.Yves Senn2014-05-193-24/+30
| | | | Partial revert of c0bfc3f412834ffe8327a15ae3a46602cc28e425
* pg, add missing nodocs for extracted modules.Yves Senn2014-05-194-6/+6
|
* Merge pull request #15156 from sgrif/sg-postgres-timestampsYves Senn2014-05-181-6/+3
|\ | | | | PostgreSQL timestamps should always be datetimes
| * PostgreSQL timestamps are always datetimesSean Griffin2014-05-171-6/+3
| | | | | | | | | | | | | | | | The current behavior is that they are treated as `datetime` normally, but if they are part of an array, they are treated as `timestamp`. The only place that seems to be impacted by this is schema dumping, which shouldn't matter since `t.datetime` and `t.timestamp` are equivalent in the `PostgreSQL` adapter, anyway.
* | Add a type object to Column constructorSean Griffin2014-05-171-2/+2
|/ | | | | | Part of #15134. In order to perform typecasting polymorphically, we need to add another argument to the constructor. The order was chosen to match the `oid_type` on `PostgreSQLColumn`.
* :scissors:Rafael Mendonça França2014-05-142-2/+0
|
* Methods of these modules are internalRafael Mendonça França2014-05-142-14/+14
| | | | | They should not be used on people application so they should not be present on the API documentation.
* PostgreSQLAdapter::Utils seems to be only used from a single spot - quite ↵kares2014-05-141-1/+19
| | | | redundant
* move PostgreSQL's DatabaseStatements out of the PostgreSQLAdapter name-spacekares2014-05-141-1/+6
|
* PostgreSQL's SchemaStatements seems a could candidate for re-use (with AR-JDBC)kares2014-05-141-6/+2
|
* introduce AR::ConnectionAdapters::PostgreSQL for sharing modules (with AR-JDBC)kares2014-05-146-9/+10
| | | ... 'shared' OID, ArrayParser and Cast helpers, also re-arranged Column's dependencies
* Merge pull request #15092 from kares/pg-array-parserRafael Mendonça França2014-05-132-27/+27
|\ | | | | [postgres] include PgArrayParser directly
| * [postgres] include PgArrayParser directly and only load/include ArrayParser ↵kares2014-05-132-27/+27
| | | | | | | | if not found
* | extract pg type map initialization process to `TypeMapInitializer`.Yves Senn2014-05-131-0/+71
|/
* pg, `change_column_default` accepts `[]`. Closes #11586.Yves Senn2014-05-122-2/+3
|
* pg, map `char` and `name` types as string. [dark-panda & Yves Senn]Yves Senn2014-05-121-0/+1
| | | | Closes #10802.
* pg, fix Infinity and NaN values conversion.Innokenty Mihailov2014-05-121-3/+8
| | | | Before this patch `Infinity`, `-Infinity` and `Nan` were read as `0`.
* Handle other pk types in PostgreSQL gracefully.Patrick Robertson2014-05-121-1/+1
| | | | | | | | | | | | | | In #10410 it was noted that you can no longer create PK's with the type of bigserial in PostgreSQL in 4.0.0.rc1. This is mostly because the newer adapter is checking for column type with the id column instead of just letting it pass through like it did before. Side effects: You may just create a PK column of a type that you really don't want to be your PK. As far as I can tell this was allowed in 3.2.X and perhaps an exception should be raised if you try and do something extremely dumb.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-05-101-0/+3
|\
| * copy edits [ci skip]Vijay Dev2014-05-081-1/+1
| |
| * [ci skip] document type_cast_for_writeschneems2014-05-071-0/+3
| |
* | refactor, move `column_for` to `AbstractAdapter` for better reuse.Yves Senn2014-05-041-4/+0
|/
* PostgreSQL Timestamps always map to `:datetime`.Jefferson Lai2014-04-241-6/+1
| | | | | | | The PG Adapter should use `:datetime` consistently instead of mapping mispellings to `:timestamp`. See #14513
* Optimize select_value, select_values, select_rows and dry up checking ↵Kris Selden2014-04-171-19/+33
| | | | | whether to exec with cache for Postgresql adapter Reduces creating unused objects, with the most dramatic reduction in select_values which used to map(&:first) an array of single element arrays.
* Changed change_column in PG schema_statements.rb to make sure that the ↵Eric Chahin2014-04-152-2/+17
| | | | uuid_generate function was not being quoted.
* PostgreSQL, adapter automatically reloads it's type map. Closes #14678.Yves Senn2014-04-112-7/+2
| | | | [Yves Senn & Matthew Draper]
* Use connection-specific bytea escapingMatthew Draper2014-04-081-2/+2
| | | | | | | | | | In our normal usage, it's rare for this to make a difference... but is more technically correct. As well as a spec that proves this is a good idea, let's also add a more sane-looking one that just covers basic to_sql functionality. There aren't many places where we actually use escape_bytea, but that's one that won't be going away.
* Treat blank UUID values as nilDmitry Lavrov2014-04-031-1/+8
|
* PostgreSQL, Support for materialized views. [Dave Lee & Yves Senn]Dave Lee2014-04-021-4/+1
| | | | | Expand the query used in #table_exists? to include materialized views in the kinds of relations it searches.
* PostgreSQL determine `Column#type` through corresponding OID. #7814Yves Senn2014-04-012-101/+91
| | | | | | | | | | | | | I ran the whole test suite and compared the old to the new types. Following is the list of types that did change with this patch: ``` DIFFERENT TYPE FOR mood: NEW: enum, BEFORE: DIFFERENT TYPE FOR floatrange: NEW: floatrange, BEFORE: float ``` The `floatrange` is a custom type. The old type `float` was simply a coincidence form the name `floatrange` and our type-guessing.
* refactor, put `PostgreSQLColumn` into `column.rb`.Yves Senn2014-03-311-0/+221
| | | | | We have `connection_adapters/column.rb` so it's easier to remember that the column in in a separate file.
* Postgres schema: Constrain sequence search classidJosh Williams2014-03-201-0/+1
| | | | | | | | | | | The pk_an_sequence_for query previously joined against pg_class's oid for rows in pg_depend, but pg_depend's objid may point to other system tables, such as pg_attrdef. If a row in one of those other tables coincidentally has the same oid as an (unrelated) sequence, that sequence name may be returned instead of the real one. This ensures that only the pg_depend entries pointing to pg_class are considered.
* register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester]lsylvester2014-03-111-0/+1
| | | | citext makes it possible to use AR Hash finders for case-insensitive matching as sql UPPER/LOWER functions are not needed.
* Add Enum type to postgresql adapter's oids to prevent unknown OID warnings.Dieter Komendera2014-03-041-0/+6
|
* Coerce strings when reading attributes.Yves Senn2014-02-231-5/+13
|
* deprecate support for pg ranges with excluding beginnings.Yves Senn2014-02-231-0/+12
| | | | | | | | | | | | | | | The Ruby Range object does not support excluding beginnings. We currently support excluding beginnings for some subtypes using manually by incrementing them (now using the `#succ` method). This is approach is flawed as it's not equal to an excluding beginning. This commit deprecates the current support for excluding beginnings. It also raises an `ArgumentError` for subtypes that do not implement the `succ` method. This is a temporary solution to get rid of the broken state. We might still add complete support for excluding beginnings afterwards. (Probably with a new `PGRange` object, which acts like a `Range` but has excluding beginnings.
* dynamically define PostgreSQL OID range types.Yves Senn2014-02-231-36/+14
| | | | | | | | This gets AR working with custom defined range types. It also removes the need for subtype specific branches in `OID::Range`. This expands the interface of all `OID` types with the `infinity` method. It's responsible to provide a value for positive and negative infinity.
* Merge branch '4-1-0-beta2'Rafael Mendonça França2014-02-181-1/+5
|\ | | | | | | | | | | Conflicts: actionview/CHANGELOG.md activerecord/CHANGELOG.md
| * Correctly escape PostgreSQL arrays.Aaron Patterson2014-02-181-1/+5
| | | | | | | | | | | | Thanks Godfrey Chan for reporting this! Fixes: CVE-2014-0080
* | Resolve encoding issues with arrays of hstore (bug 11135).Josh Goodall2014-02-172-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We didn't have enough encoding for the wire protocol to store an array of hstore types. So, further encode any hstore that is an array member. Whilst we're here, ensure it's an HashWithIndifferentAccess being returned, to be consistent with other serialized forms, and add testing for arrays of hstore. So now the following migration: enable_extension "hstore" create_table :servers do |t| t.string :name t.hstore :interfaces, array: true end produces a model that can used like this, to store an array of hashes: server = Server.create(name: "server01", interfaces: [ { name: "bge0", ipv4: "192.0.2.2", state: "up" }, { name: "de0", state: "disabled", by: "misha" }, { name: "fe0", state: "up" }, ]) More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
* | Merge pull request #13688 from jbaudanza/psql-index-existsRafael Mendonça França2014-02-011-0/+13
|\ \ | | | | | | | | | | | | | | | | | | PostgreSQL implementation of SchemaStatements#index_name_exists? Conflicts: activerecord/CHANGELOG.md
| * | psql implementation of #index_name_exists?Jonathan Baudanza2014-01-161-0/+13
| | |
* | | Fixes issue with parsing whitespace content back from database - fixes #13907Mauricio Linhares2014-02-011-2/+3
| | |
* | | Fix regression on `.select_*` methods.Arthur Neves2014-01-301-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a common pattern: ``` query = author.posts.select(:title) connection.select_one(query) ``` However `.select` returns a ActiveRecord::AssociationRelation, which has the bind information, so we can use that to get the right sql query. Also fix select_rows on postgress and sqlite3 that were not using the binds [fixes #7538] [fixes #12017] [related #13731] [related #12056]
* / fix quoting non-stringsDamien Mathieu2013-12-221-1/+1
|/ | | | Closes #13444
* Use the right type_mapRafael Mendonça França2013-12-052-5/+3
|
* make the type_map per connection. fixes #13182Aaron Patterson2013-12-041-1/+1
|
* Typo fixes [ci skip]Akshay Vishnoi2013-11-301-1/+1
|
* Drop unused param `should_be_quoted` to `PostgreSQLColumn#array_to_string`Vipul A M2013-11-171-1/+1
|
* Change array check for better aesthetics / reading the codeCarlos Antonio da Silva2013-11-091-1/+1
|