提交 3080b273 编写于 作者: J Jeremy Kemper

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
上级 c4233a0e
*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]
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册