File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,3 +203,25 @@ TABLE tab3_new_part_4;
203203 4 | 4
204204(4 rows)
205205
206+ -- Change of precision and scale of a numeric data type.
207+ CREATE TABLE tab4(i int PRIMARY KEY, j numeric(3, 1));
208+ INSERT INTO tab4(i, j) VALUES (1, 0.1);
209+ CREATE TABLE tab4_new(i int PRIMARY KEY, j numeric(4, 2));
210+ TABLE tab4;
211+ i | j
212+ ---+-----
213+ 1 | 0.1
214+ (1 row)
215+
216+ SELECT rewrite_table('tab4', 'tab4_new', 'tab4_orig');
217+ rewrite_table
218+ ---------------
219+
220+ (1 row)
221+
222+ TABLE tab4;
223+ i | j
224+ ---+------
225+ 1 | 0.10
226+ (1 row)
227+
Original file line number Diff line number Diff line change @@ -81,3 +81,11 @@ TABLE tab3_new_part_1;
8181TABLE tab3_new_part_2;
8282TABLE tab3_new_part_3;
8383TABLE tab3_new_part_4;
84+
85+ -- Change of precision and scale of a numeric data type.
86+ CREATE TABLE tab4 (i int PRIMARY KEY , j numeric (3 , 1 ));
87+ INSERT INTO tab4(i, j) VALUES (1 , 0 .1 );
88+ CREATE TABLE tab4_new (i int PRIMARY KEY , j numeric (4 , 2 ));
89+ TABLE tab4;
90+ SELECT rewrite_table(' tab4' , ' tab4_new' , ' tab4_orig' );
91+ TABLE tab4;
You can’t perform that action at this time.
0 commit comments