Commit 7248f4a
committed
Postgres producer ALTER COLUMN: specify USING for datatype change
Postgres 8 and later require a C<< USING expression >> clause when
changing the type of a column in a potentially lossy manner, such
as from C<text> to C<numeric>.
This change adds an automatic "USING (colname::datatype)" suffix
any time the data type has changed, which should be a safe default.
It is also conditioned on the version of Postgres, but also makes
it the default in absence of a version, since Pg 8 is so old.1 parent 18be6d1 commit 7248f4a
4 files changed
Lines changed: 27 additions & 17 deletions
File tree
- lib/SQL/Translator/Producer
- t
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
910 | 916 | | |
911 | 917 | | |
912 | 918 | | |
| 919 | + | |
| 920 | + | |
913 | 921 | | |
914 | 922 | | |
915 | | - | |
| 923 | + | |
916 | 924 | | |
917 | 925 | | |
918 | 926 | | |
919 | 927 | | |
920 | | - | |
| 928 | + | |
921 | 929 | | |
922 | 930 | | |
923 | 931 | | |
924 | 932 | | |
925 | | - | |
| 933 | + | |
926 | 934 | | |
927 | 935 | | |
928 | 936 | | |
929 | 937 | | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
934 | 944 | | |
935 | 945 | | |
936 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments