aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
index 0ebed21717..095429dd89 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
@@ -86,15 +86,23 @@ module ActiveRecord
COLUMN_NAME_WITH_ORDER
end
- COLUMN_NAME = /\A(?:("?)\w+\k<1>\.)?("?)\w+\k<2>(?:::\w+)?\z/i
+ COLUMN_NAME = /
+ \A
+ (
+ (?:\w+\.|"\w+"\.)?(?:\w+|"\w+")(?:::\w+)?
+ )
+ (?:\s*,\s*\g<1>)*
+ \z
+ /ix
COLUMN_NAME_WITH_ORDER = /
\A
- (?:("?)\w+\k<1>\.)?
- ("?)\w+\k<2>
- (?:::\w+)?
- (?:\s+ASC|\s+DESC)?
- (?:\s+NULLS\s+(?:FIRST|LAST))?
+ (
+ (?:\w+\.|"\w+"\.)?(?:\w+|"\w+")(?:::\w+)?
+ (?:\s+ASC|\s+DESC)?
+ (?:\s+NULLS\s+(?:FIRST|LAST))?
+ )
+ (?:\s*,\s*\g<1>)*
\z
/ix