aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* Push limit to type objectsSean Griffin2014-05-221-9/+0
| | | | | Columns and injected types no longer have any conditionals based on the format of SQL type strings! Hooray!
* Push scale to type objectsSean Griffin2014-05-221-1/+1
| | | | | | Ideally types will be usable without having to specify a sql type string, so we should keep the information related to parsing them on the adapter or another object.
* Move `extract_precision` onto type objectsDan Croak and Sean Griffin2014-05-222-13/+2
|
* Merge pull request #15249 from sgrif/sg-register-types-in-adapterRafael Mendonça França2014-05-222-73/+13
|\ | | | | Use the generic type map for all PG type registrations
| * Use the generic type map for all PG type registrationsSean Griffin2014-05-222-73/+13
| | | | | | | | | | | | | | 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
* | Allow additional arguments to be used during type map lookupsSean Griffin2014-05-221-1/+1
|/ | | | | | | | Determining things like precision and scale in postgresql will require the given blocks to take additional arguments besides the OID. - Adds the ability to handle additional arguments to `TypeMap` - Passes the column type to blocks when looking up PG types
* Merge pull request #15218 from sgrif/sg-move-oid-typesRafael Mendonça França2014-05-2123-353/+532
|\ | | | | Move PG OID types to their own files
| * Move PG OID types to their own filesSean Griffin2014-05-2123-353/+532
| | | | | | | | | | | | | | 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.
* | Rename `oid_type` to `cast_type` to make PG columns consistentSean Griffin2014-05-211-5/+4
|/
* push `extract_scale` to the `Type`.Yves Senn2014-05-212-6/+4
| | | | | | | - `extract_precision`, `extract_limit`, and `extract_default` probably need to follow. - would be good to remove the delegation `Column#extract_scale`. /cc @sgrif
* Delegate `type_cast_for_write` to injected type objectSean Griffin2014-05-201-11/+0
|
* 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-202-8/+4
|/
* Merge pull request #15203 from sgrif/sg-delegate-type-castRafael Mendonça França2014-05-201-7/+0
|\ | | | | Replace `type_cast` case statement with delegation
| * Replace `type_cast` case statement with delegationSean Griffin2014-05-201-7/+0
| | | | | | | | | | | | | | | | All subclasses of column were now delegating `type_cast` to their injected type object. We can remove the overriding methods, and generalize it on the `Column` class itself. This also enabled us to remove several column classes completely, as they no longer had any meaningful behavior of their own.
* | Have Postgres OID types inherit from general typesSean Griffin2014-05-202-146/+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-192-13/+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, 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.