@@ -36,7 +36,7 @@ def run
3636 dump . gsub! ( /^COMMENT ON EXTENSION .*/ , '' )
3737
3838 # Remove useless, version-specific parts of comments
39- dump . gsub! ( /^-- (.*); Schema: ([\w _ \. ]+|-); Owner: -.*/ , '-- \1' )
39+ dump . gsub! ( /^-- (.*); Schema: ([\w \. ]+|-); Owner: -.*/ , '-- \1' )
4040
4141 # Remove useless comment lines
4242 dump . gsub! ( /^--$/ , '' )
@@ -47,8 +47,8 @@ def run
4747 # This is a bit optimistic, but works as long as you don't have an id field thats not a sequence/uuid
4848 dump . gsub! ( /^ id integer NOT NULL(,)?$/ , ' id SERIAL PRIMARY KEY\1' )
4949 dump . gsub! ( /^ id bigint NOT NULL(,)?$/ , ' id BIGSERIAL PRIMARY KEY\1' )
50- dump . gsub! ( /^ id uuid DEFAULT ([\w _ ]+\. )?uuid_generate_v4\( \) NOT NULL(,)?$/ , ' id uuid DEFAULT \1uuid_generate_v4() PRIMARY KEY\2' )
51- dump . gsub! ( /^ id uuid DEFAULT ([\w _ ]+\. )?gen_random_uuid\( \) NOT NULL(,)?$/ , ' id uuid DEFAULT \1gen_random_uuid() PRIMARY KEY\2' )
50+ dump . gsub! ( /^ id uuid DEFAULT ([\w ]+\. )?uuid_generate_v4\( \) NOT NULL(,)?$/ , ' id uuid DEFAULT \1uuid_generate_v4() PRIMARY KEY\2' )
51+ dump . gsub! ( /^ id uuid DEFAULT ([\w ]+\. )?gen_random_uuid\( \) NOT NULL(,)?$/ , ' id uuid DEFAULT \1gen_random_uuid() PRIMARY KEY\2' )
5252 dump . gsub! ( /^CREATE SEQUENCE [\w \. ]+_id_seq\s +(AS integer\s +)?START WITH 1\s +INCREMENT BY 1\s +NO MINVALUE\s +NO MAXVALUE\s +CACHE 1;$/ , '' )
5353 dump . gsub! ( /^ALTER SEQUENCE [\w \. ]+_id_seq OWNED BY .*;$/ , '' )
5454 dump . gsub! ( /^ALTER TABLE ONLY [\w \. ]+ ALTER COLUMN id SET DEFAULT nextval\( '[\w \. ]+_id_seq'::regclass\) ;$/ , '' )
@@ -59,7 +59,7 @@ def run
5959 end
6060
6161 # Remove inherited tables
62- inherited_tables_regexp = /-- Name: ([\w _ \. ]+); Type: TABLE\n \n [^;]+?INHERITS \( [\w _ \. ]+\) ;/m
62+ inherited_tables_regexp = /-- Name: ([\w \. ]+); Type: TABLE\n \n [^;]+?INHERITS \( [\w \. ]+\) ;/m
6363 inherited_tables = dump . scan ( inherited_tables_regexp ) . map ( &:first )
6464 dump . gsub! ( inherited_tables_regexp , '' )
6565 inherited_tables . each do |inherited_table |
@@ -76,7 +76,7 @@ def run
7676 partitioned_tables = [ ]
7777
7878 # Postgres 12 pg_dump will output separate ATTACH PARTITION statements (even when run against an 11 or older server)
79- partitioned_tables_regexp1 = /ALTER TABLE ONLY [\w _ \. ]+ ATTACH PARTITION ([\w _ \. ]+)/
79+ partitioned_tables_regexp1 = /ALTER TABLE ONLY [\w \. ]+ ATTACH PARTITION ([\w \. ]+)/
8080 partitioned_tables += dump . scan ( partitioned_tables_regexp1 ) . map ( &:last )
8181
8282 # Earlier versions use an inline PARTITION OF
0 commit comments