Skip to content

Commit 6dc835c

Browse files
authored
Fix stuttering GUC in error/warning message (#844)
Running the command in the error/warning message would fail or do nothing. This makes it use the right command.
1 parent 922d03d commit 6dc835c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/pgduckdb_types.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,20 +1289,20 @@ ConvertPostgresToBaseDuckColumnType(Form_pg_attribute &attribute) {
12891289
if (type_modifier == -1) {
12901290
return duckdb::LogicalType::USER(
12911291
"DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to "
1292-
"a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'");
1292+
"a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'");
12931293
} else if (precision < 1 || precision > 38) {
12941294
return duckdb::LogicalType::USER(
12951295
"DuckDB only supports NUMERIC with a precision of 1-38. You can choose to convert these NUMERICs "
1296-
"to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'");
1296+
"to a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'");
12971297
} else if (scale < 0 || scale > 38) {
12981298
return duckdb::LogicalType::USER(
12991299
"DuckDB only supports NUMERIC with a scale of 0-38. You can choose to convert these NUMERICs to a "
1300-
"DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'");
1300+
"DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'");
13011301
} else {
13021302
return duckdb::LogicalType::USER(
13031303
"DuckDB does not support NUMERIC with a scale that is larger than the precision. You can choose to "
1304-
"convert these NUMERICs to a DOUBLE by using 'SET "
1305-
"duckdb.duckdb.convert_unsupported_numeric_to_double = true'");
1304+
"convert these NUMERICs to a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = "
1305+
"true'");
13061306
}
13071307
}
13081308

test/regression/expected/array_type_support.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ INSERT INTO numeric_array_1d SELECT CAST(a as NUMERIC[]) FROM (VALUES
308308
('{}')
309309
) t(a);
310310
SELECT * FROM numeric_array_1d;
311-
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'
311+
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'
312312
a
313313
--------------------
314314
{1.1,2.2,3.3}
@@ -596,7 +596,7 @@ INSERT INTO numeric_array_2d VALUES
596596
('{}'),
597597
('{{11.1,12.2},{NULL,14.4}}');
598598
SELECT * FROM numeric_array_2d;
599-
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'
599+
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'
600600
a
601601
--------------------------------
602602
{{1.1,2.2},{3.3,4.4}}

test/regression/expected/temporary_tables.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ CREATE TEMP TABLE t(a int) WITH (fillfactor = 50);
165165
ERROR: Storage options are not supported in DuckDB
166166
-- Should fail because user should specify the precision of the NUMERIC.
167167
CREATE TEMP TABLE large_numeric_tbl (a NUMERIC) USING duckdb;
168-
ERROR: (PGDuckDB/duckdb_create_table_trigger_cpp) Not implemented Error: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'
168+
ERROR: (PGDuckDB/duckdb_create_table_trigger_cpp) Not implemented Error: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'
169169
-- But it's fine if the user specifies the precision
170170
CREATE TEMP TABLE large_numeric_tbl_specified (a NUMERIC(38,20)) USING duckdb;
171171
-- CTAS is fine though, it will use duckdb its default

test/regression/expected/type_support.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ INSERT INTO numeric_as_double SELECT a FROM (VALUES
327327
(458234502034234234234.000012)
328328
) t(a);
329329
SELECT * FROM numeric_as_double;
330-
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'
330+
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.convert_unsupported_numeric_to_double = true'
331331
a
332332
------------------------------
333333
0.234234234

0 commit comments

Comments
 (0)