Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PostgreSQL: correctly quote the ' in pk_and_sequence_for. Closes #5462.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4580 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 3080b273a86d03a55b7d13c4596166d8f200c7ff 1 parent c4233a0
Jeremy Kemper jeremy authored
2  activerecord/CHANGELOG
View
@@ -1,5 +1,7 @@
*SVN*
+* PostgreSQL: correctly quote the ' in pk_and_sequence_for. #5462 [tietew@tietew.net]
+
* PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
* Clearer has_one/belongs_to model names (account has_one :user). #5632 [matt@mattmargolis.net]
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
View
@@ -303,7 +303,7 @@ def pk_and_sequence_for(table)
# the 8.1+ nextval('foo'::regclass).
# TODO: assumes sequence is in same schema as table.
result = query(<<-end_sql, 'PK and custom sequence')[0]
- SELECT attr.attname, name.nspname, split_part(def.adsrc, '\\\'', 2)
+ SELECT attr.attname, name.nspname, split_part(def.adsrc, '''', 2)
FROM pg_class t
JOIN pg_namespace name ON (t.relnamespace = name.oid)
JOIN pg_attribute attr ON (t.oid = attrelid)
Please sign in to comment.
Something went wrong with that request. Please try again.