@@ -128,9 +128,30 @@ schema 'public' in the target database with this command::
128
128
ALTER TABLE NAMES MATCHING ... IN SCHEMA '...'
129
129
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130
130
131
- See the MS SQL explanation for this clause above. It works the same in the
132
- context of migrating from MS SQL, only with the added option to specify the
133
- name of the schema where to find the definition of the target tables.
131
+ Introduce a comma separated list of table names or *regular expressions *
132
+ that you want to target in the pgloader *ALTER TABLE * command. Available
133
+ actions are *SET SCHEMA *, *RENAME TO *, and *SET *::
134
+
135
+ ALTER TABLE NAMES MATCHING ~/_list$/, 'sales_by_store', ~/sales_by/
136
+ IN SCHEMA 'dbo'
137
+ SET SCHEMA 'mv'
138
+
139
+ ALTER TABLE NAMES MATCHING 'film' IN SCHEMA 'dbo' RENAME TO 'films'
140
+
141
+ ALTER TABLE NAMES MATCHING ~/./ IN SCHEMA 'dbo' SET (fillfactor='40')
142
+
143
+ You can use as many such rules as you need. The list of tables to be
144
+ migrated is searched in pgloader memory against the *ALTER TABLE * matching
145
+ rules, and for each command pgloader stops at the first matching criteria
146
+ (regexp or string).
147
+
148
+ No *ALTER TABLE * command is sent to PostgreSQL, the modification happens at
149
+ the level of the pgloader in-memory representation of your source database
150
+ schema. In case of a name change, the mapping is kept and reused in the
151
+ *foreign key * and *index * support.
152
+
153
+ The *SET () * action takes effect as a *WITH * clause for the `CREATE TABLE `
154
+ command that pgloader will run when it has to create a table.
134
155
135
156
The matching is done in pgloader itself, with a Common Lisp regular
136
157
expression lib, so doesn't depend on the *LIKE * implementation of MS SQL,
0 commit comments