1
|
PostgreSQL,MySQL,Comments
|
2
|
,,PostgreSQL-only features
|
3
|
(?s)^SET\b.*?;$,,
|
4
|
(?s)^(?:GRANT|REVOKE)\b.*?;$,,
|
5
|
(?s)^(?:CREATE|ALTER) (?:AGGREGATE|PROCEDURAL LANGUAGE|SEQUENCE|(?:CONSTRAINT )?TRIGGER|TYPE|VIEW)\b.*?;$,,
|
6
|
(?s)^CREATE FUNCTION\b.*?(\$\w*\$).*?\1;$,,
|
7
|
(?s)^COMMENT\b.*?';$,,
|
8
|
(?s)^ALTER TABLE\b[^;]*\bSET DEFAULT nextval\([^;]*\).*?;$,,
|
9
|
(?s)^CREATE\b[^;]*\bINDEX\b[^;]*\([^;]*\(.*?;$,,
|
10
|
",\n *CONSTRAINT\b.*\bCHECK\b.*?(?=,?$)",,
|
11
|
\bDEFAULT \w*\(.*\),,.* rather than .*? to allow nested ()
|
12
|
^(CREATE\b[^;]*\bINDEX\b[^;]*\b)USING \w+,\1,
|
13
|
(?s)^CREATE\b[^;]*\bINDEX\b[^;]*\bWHERE\b.*?;$,,
|
14
|
(?<=\bALTER TABLE )ONLY ,,
|
15
|
\bINHERITS \(.*?\),,
|
16
|
\[\],,arrays
|
17
|
(?s)^COPY\b.*?^\\\.$,,
|
18
|
^SELECT pg_catalog.setval\b.*?;$,,
|
19
|
,,syntax changes
|
20
|
^--(?=\S),\g<0> ,
|
21
|
"""([^""]*?)""",`\1`,
|
22
|
(?<=DEFAULT )(\d+|'[^']*')::\w+(?: [a-z]+)*,\1,
|
23
|
(\d+|'[^']*')::(\w+(?: \w+)*),CAST(\1 AS \2),
|
24
|
,,datatypes
|
25
|
\bserial( NOT NULL\b)?,int(11)\1 AUTO_INCREMENT,
|
26
|
oid,int(11),
|
27
|
integer,int(11),
|
28
|
boolean,int(1),
|
29
|
bytea,blob,
|
30
|
with time zone\b,,
|
31
|
fulltext,`\g<0>`,
|
32
|
\btimestamp\b(?: with time zone\b)?(?! NOT NULL\b),\g<0> NULL,
|
33
|
^( *`?[a-z]\w*`? )(?!(?:date|datetime|double|int|text|time|timestamp)\b)\w+(?=\b[^;]*^\);),\1text,custom types
|
34
|
text,varchar(255),text columns can't be used in indexes
|