Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote
От | Nathan Bossart |
---|---|
Тема | Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote |
Дата | |
Msg-id | Z-a1m_eDU-yKlMWq@nathan обсуждение исходный текст |
Ответ на | Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote (Mahendra Singh Thalor <mahi6run@gmail.com>) |
Ответы |
Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote
Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote |
Список | pgsql-hackers |
On Fri, Mar 28, 2025 at 05:08:26PM +0530, Mahendra Singh Thalor wrote: > Here, I am attaching updated patches for review. > > v04_001* has the changes for CREATE DATABASE/ROLE/USER and > v04_002* has the changes into pg_upgrade to give ALERTS for invalid names. In general, +1 for these changes. Thanks for picking this up. If these are intended for v18, we probably should have a committer attached to it soon. I'm not confident that I'll have time for it, unfortunately. + /* Report error if dbname have newline or carriage return in name. */ + if (strpbrk(dbname, "\n\r")) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE)), + errmsg("database name contains a newline or carriage return character"), + errhint("newline or carriage return character is not allowed in database name")); I think it would be better to move this to a helper function instead of duplicating this code in several places. Taking a step back, are we sure that 1) this is the right place to do these checks and 2) we shouldn't apply the same restrictions to all names? I'm wondering if it would be better to add these checks to the grammar instead of trying to patch up all the various places they are used in the tree. -- nathan
В списке pgsql-hackers по дате отправления: