| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Postgresql adapter: fix handling of BC timestamps
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
This will solve the issue that abort the connection transaction when we
skip the tests.
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Didn't fail the test because adapter#query happens to
not call raw connection's #query, but don't want to count
on that and have a fragile test.
|
|
|
|
|
|
| |
Full test requiring manual intervention was fine, but
w/ simulated disconnect, assertion was backward & still
passing. Was several kinds of wrong.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch addresses the difficulty of retrieving datetime fields. By default, the database holds a higher precision than the time as a String.
This issue is discussed at length at the following links:
- [#3519](https://github.com/rails/rails/issues/3519)
- [#3520](https://github.com/rails/rails/issues/3520)
Also, kudos to @mattscilipoti
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
postgresql adapter should quote not a number and infinity correctly for float columns
|
| | |
|
|\ \
| | |
| | | |
Support postgresql partitioning by making INSERT RETURNING optional
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
things
|
|/ /
| |
| |
| |
| |
| |
| | |
escape_hstore uses quotation marks around keys and values only if it
seems necessary. However, it currently breaks in the presence of some
non-ASCII characters. Instead of trying to guess exactly which
characters are safe, it seems better to always use quotes.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
nonmatching sequence default value for PK.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
postgres docs
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The `add_index` method now supports a `where` option that receives a
string with the partial index criteria.
add_index(:accounts, :code, :where => "active")
Generates
CREATE INDEX index_accounts_on_code ON accounts(code) WHERE active
|
| | |
|
| | |
|
| | |
|
| | |
|