On Thu, Aug 22, 2024 at 04:00:13PM +0530, Nishant Sharma wrote:
> I may be wrong, but just wanted to share my thoughts on the differences.
> So, it
> can be considered a different issue/mistake and can be handled separately in
> another email thread.

+        else if (strcmp(def->defname, "column_name") == 0)
+        {
+            char       *col_name_opt = defGetString(def);
+
+            /*
+             * PostgresSQL follows SQL syntax, so we do not allow empty
+             * column_name option.
+             */
+            if (col_name_opt && col_name_opt[0] == '\0')
+                ereport(ERROR,
+                        (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                         errmsg("colum_name option cannot be empty for 
postgres_fdw")));
+        }

If we begin to care about empty names in column_name in the FDW
command, shouldn't we also care about empry values in schema_name and
table_name?

Typos: PostgresSQL -> PostgreSQL and colum_name -> column_name.

Once you associate table_name and schema_name, you can save in
translation by rewording the errmsg like that (no need to mention
postgres_fdw, note the quotes around the option name):
errmsg("cannot use empty value for option \"%s\"",
       "column_name");
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to