Skip to content

Commit

Permalink
#7914 Remove code for unsupported postgreSQL version.
Browse files Browse the repository at this point in the history
Remove parsing of character type default values for 8.1 formatting since
Rails doesn't support postgreSQL 8.1 anymore.

Remove misleading comment unrelated to code.
  • Loading branch information
arturopie committed Oct 14, 2012
1 parent 40475cf commit 8fb841b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
Expand Up @@ -280,9 +280,6 @@ def pk_and_sequence_for(table) #:nodoc:
end_sql

if result.nil? or result.empty?
# If that fails, try parsing the primary key's default value.
# Support the 7.x and 8.0 nextval('foo'::text) as well as
# the 8.1+ nextval('foo'::regclass).
result = query(<<-end_sql, 'SCHEMA')[0]
SELECT attr.attname,
CASE
Expand Down
Expand Up @@ -80,9 +80,6 @@ def self.extract_value_from_default(default)
# Character types
when /\A\(?'(.*)'::.*\b(?:character varying|bpchar|text)\z/m
$1
# Character types (8.1 formatting)
when /\AE'(.*)'::(?:character varying|bpchar|text)\z/m
$1.gsub(/\\(\d\d\d)/) { $1.oct.chr }
# Binary data types
when /\A'(.*)'::bytea\z/m
$1
Expand Down

0 comments on commit 8fb841b

Please sign in to comment.