aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* AR supporting new intrange data type on PostgreSQL >= 9.2Alexey2012-12-161-0/+11
|
* Moves column dump specific code to a module included in AbstractAdapterDan McClain2012-09-141-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having column related schema dumper code in the AbstractAdapter. The code remains the same, but by placing it in the AbstractAdapter, we can then overwrite it with Adapter specific methods that will help with Adapter specific data types. The goal of moving this code here is to create a new migration key for PostgreSQL's array type. Since any datatype can be an array, the goal is to have ':array => true' as a migration option, turning the datatype into an array. I've implemented this in postgres_ext, the syntax is shown here: https://github.com/dockyard/postgres_ext#arrays Adds array migration support Adds array_test.rb outlining the test cases for array data type Adds pg_array_parser to Gemfile for testing Adds pg_array_parser to postgresql_adapter (unused in this commit) Adds schema dump support for arrays Adds postgres array type casting support Updates changelog, adds note for inet and cidr support, which I forgot to add before Removing debugger, Adds pg_array_parser to JRuby platform Removes pg_array_parser requirement, creates ArrayParser module used by PostgreSQLAdapter
* ActiveRecord support to PostgreSQL 9.2 JSON typeDickson S. Guedes2012-09-051-0/+9
| | | | | | | | | This implements the support to encode/decode JSON data to/from database and creating columns of type JSON using a native type [1] supported by PostgreSQL from version 9.2. [1] http://www.postgresql.org/docs/9.2/static/datatype-json.html
* Add uuid type support to PostgreSQL adapterKonstantin Shabanov2012-06-141-0/+1
|
* Converts inet and cidr columns to NetAddr::CIDRDan Seaver2012-05-071-3/+12
|
* PG column consults oid types when typecastingAaron Patterson2012-02-101-2/+3
|
* dynamically populate casting objects via the pg_type tableAaron Patterson2012-02-101-35/+57
|
* Merge branch 'joelhoffman-postgres_schema_builder' into instance_readerAaron Patterson2012-02-101-1/+1
| | | | | | | | | | | | | | * joelhoffman-postgres_schema_builder: Also support writing the hstore back to the database Hstore values are all strings string_to_hstore / hstore_to_string, serializing don't test schema where hstore not installed schema dumper tests for hstore Additional hstore tests, supporting null values, better compliance with postgres docs add hstore to postgres native types and defaults Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb