aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
Commit message (Collapse)AuthorAgeFilesLines
* PostgreSQL: Treat infinite values in date like datetime consistentlyRyuta Kamizono2018-02-231-0/+1
| | | | | | | | | | | | | | The values infinity and -infinity are supported by both date and timestamp types. https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-TABLE And also, it can not be known whether a value is infinity correctly unless cast a value. I've added `QueryAttribute#infinity?` to handle that case. Closes #27585.
* [Active Record] require => require_relativeAkira Matsuda2017-10-211-21/+21
| | | | This basically reverts 9d4f79d3d394edb74fa2192e5d9ad7b09ce50c6d
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Remove database specific JSON typesRyuta Kamizono2017-07-051-1/+0
| | | | We already have database agnostic `Type::Json` since #29220.
* [Active Record] require => require_relativeAkira Matsuda2017-07-011-22/+22
|
* Schema dumping support for PostgreSQL oid typeRyuta Kamizono2017-02-121-0/+1
| | | | Closes #27980
* Remove deprecated handling of PG PointsSean Griffin2016-08-311-1/+1
| | | | | | | | | | There are some minor changes to the point type as I had forgotten that this will affect the behavior of `t.point` in migrations and the schema dumper so we need to handle those as well. I'll say this again so I can convince myself to come up with a better structure... TYPES SHOULD NOT CARE ABOUT SCHEMA DUMPING AND WE NEED TO BETTER SEPARATE THESE.
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-21/+21
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Return a `Point` object from the PG Point typeSean Griffin2015-06-051-0/+1
| | | | | | | | | | | | | | | | | | | This introduces a deprecation cycle to change the behavior of the default point type in the PostgreSQL adapter. The old behavior will continue to be available for the immediate future as `:legacy_point`. The current behavior of returning an `Array` causes several problems, the most significant of which is that we cannot differentiate between an array of points, and a point itself in the case of a column with the `point[]` type. The attributes API gives us a reasonable way to have a proper deprecation cycle for this change, so let's take advantage of it. If we like this change, we can also add proper support for the other geometric types (line, lseg, box, path, polygon, and circle), all of which are just aliases for string today. Fixes #20441
* Remove most PG specific type subclassesSean Griffin2015-02-111-6/+0
| | | | | | | | | The latest version of the PG gem can actually convert the primitives for us in C code, which gives a pretty substantial speed up. A few cases were only there to add the `infinity` method, which I just put on the range type (which is the only place it was used). Floats also needed to parse `Infinity` and `NaN`, but it felt reasonable enough to put that on the generic form.
* Add support for Postgresql JSONBPhilippe Creux2014-07-241-0/+1
| | | | [Philippe Creux, Chris Teague]
* Don't rely on the sql type to quote XML columns in PGSean Griffin2014-07-061-0/+1
|
* pg, preserve type when schema dumping bit and bit varying columns.Yves Senn2014-06-031-0/+1
|
* Use the generic type map for all PG type registrationsSean Griffin2014-05-221-67/+0
| | | | | | | We're going to want all of the benefits of the type map object for registrations, including block registration and real aliasing. Moves type name registrations to the adapter, and aliases the OIDs to the named types
* Move PG OID types to their own filesSean Griffin2014-05-211-353/+25
| | | | | | | As we promote these classes to first class concepts, these classes are starting to gain enough behavior to warrant being moved into their own files. Many of them will become quite large as we move additional behavior to the type objects.
* push `extract_scale` to the `Type`.Yves Senn2014-05-211-0/+4
| | | | | | | - `extract_precision`, `extract_limit`, and `extract_default` probably need to follow. - would be good to remove the delegation `Column#extract_scale`. /cc @sgrif
* Merge pull request #15206 from sgrif/sg-type-map-postgresqlRafael Mendonça França2014-05-201-42/+5
|\ | | | | Use the generic type map for PostgreSQL OID registrations
| * Use the generic type map for PostgreSQL OID registrationsSean Griffin2014-05-201-42/+5
| |
* | Delegate predicate methods to injected type object on ColumnSean Griffin2014-05-201-0/+4
|/
* Have Postgres OID types inherit from general typesSean Griffin2014-05-201-133/+80
| | | | | Using general types where possible. Several more can go away once infinity gets figured out.
* Delegate `Column#type` to the injected type objectSean Griffin2014-05-191-8/+5
| | | | | | | | | | | | | | | | The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.
* pg, add missing nodocs for extracted modules.Yves Senn2014-05-191-1/+1
|
* 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.
* introduce AR::ConnectionAdapters::PostgreSQL for sharing modules (with AR-JDBC)kares2014-05-141-3/+1
| | | ... 'shared' OID, ArrayParser and Cast helpers, also re-arranged Column's dependencies
* extract pg type map initialization process to `TypeMapInitializer`.Yves Senn2014-05-131-0/+71
|
* 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`.
* 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
* Treat blank UUID values as nilDmitry Lavrov2014-04-031-1/+8
|
* PostgreSQL determine `Column#type` through corresponding OID. #7814Yves Senn2014-04-011-37/+90
| | | | | | | | | | | | | 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.
* 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.
* Use the right type_mapRafael Mendonça França2013-12-051-4/+2
|
* Typo fixes [ci skip]Akshay Vishnoi2013-11-301-1/+1
|
* cast json values on write to be consistent with reading from the db.Severin Schoepke2013-10-251-0/+4
| | | | See also commit 5ac2341fab689344991b2a4817bd2bc8b3edac9d
* `ActiveRecord::Store` works together with PG `hstore` columns.Yves Senn2013-10-251-0/+8
| | | | | | 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.
* PG adapter deals with negative money values formatted with parenthesis.Yves Senn2013-08-261-0/+5
| | | | Closes #11899.
* cast hstore values on write to be consistent with reading from the db.Yves Senn2013-08-081-4/+4
|
* Add OID::Bit for supporting bit string.kennyj2013-04-161-2/+12
|
* fix for the bytea/binary nil value bugMatt Aimonetti2013-04-141-0/+1
|
* Make Postgres point type correspond to ruby array with two floats insideMartin Schürrer2013-03-251-0/+11
|
* Fix PostgreSQL TIMESTAMP WITH TIME ZONE to return ActiveSupport::TimeTroy Kruthoff2013-03-011-4/+1
| | | | | | | | | | In an AR model a timestamptz attribute would return a ruby string and AR tests did not check for any type casting. Previous tests would pass only because an assert_equal was being used on a Time.utc object, which will parse the right side of the eq to a valid Time instance for comparision. switch to test instance of Time instead of ActiveSupport::TimeWithZone
* Fix typoRafael Mendonça França2013-01-311-2/+2
|
* reloading type map on extension changingAaron Patterson2013-01-291-0/+4
|
* Add postgresql range types supportbUg2013-01-231-11/+65
|
* Support for PostgreSQL's ltree data type.Rob Worley2013-01-041-0/+1
|
* Reuse the Column integer converterRafael Mendonça França2013-01-031-1/+1
|