mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-10 00:07:00 +02:00
Fix conjunctions for the INCLUDING clause in MySQL.
We want all table matching any of the given constraints (regexp or equality search).
This commit is contained in:
parent
128cb4c80a
commit
8a0c91fa40
@ -184,7 +184,7 @@ order by table_name" dbname only-tables))))
|
||||
join information_schema.tables t using(table_schema, table_name)
|
||||
where c.table_schema = '~a' and t.table_type = '~a'
|
||||
~:[~*~;and table_name in (~{'~a'~^,~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ and ~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ or ~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ and ~})~]
|
||||
order by table_name, ordinal_position"
|
||||
dbname
|
||||
@ -226,7 +226,7 @@ order by table_name, ordinal_position"
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = '~a'
|
||||
~:[~*~;and table_name in (~{'~a'~^,~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ and ~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ or ~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ and ~})~]
|
||||
GROUP BY table_name, index_name;"
|
||||
dbname
|
||||
@ -299,7 +299,7 @@ GROUP BY table_name, index_name;"
|
||||
AND k.referenced_table_schema = '~a'
|
||||
AND i.constraint_type = 'FOREIGN KEY'
|
||||
~:[~*~;and table_name in (~{'~a'~^,~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ and ~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ or ~})~]
|
||||
~:[~*~;and (~{table_name ~a~^ and ~})~]
|
||||
|
||||
GROUP BY table_name, constraint_name, ft;"
|
||||
|
@ -2,7 +2,8 @@ LOAD DATABASE
|
||||
FROM mysql://root@unix:/tmp/mysql.sock:/goeuro
|
||||
INTO postgresql://dim@unix:/tmp:/godollar
|
||||
|
||||
-- INCLUDING ONLY TABLE NAMES MATCHING ~/encoding/
|
||||
INCLUDING ONLY TABLE NAMES MATCHING ~/encoding/, ~/b/
|
||||
EXCLUDING TABLE NAMES MATCHING ~/encoding/
|
||||
|
||||
DECODING TABLE NAMES MATCHING ~/messed/, ~/encoding/ AS utf-8
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user