Re: [HACKERS] Disallowing multiple queries per PQexec()
От | Daniel Verite |
---|---|
Тема | Re: [HACKERS] Disallowing multiple queries per PQexec() |
Дата | |
Msg-id | b08edad5-f9d0-4dbd-a999-d529f46ac8fe@manitou-mail.org обсуждение исходный текст |
Ответ на | Re: [HACKERS] Disallowing multiple queries per PQexec() (Surafel Temesgen <surafel3000@gmail.com>) |
Ответы |
Re: [HACKERS] Disallowing multiple queries per PQexec()
Re: [HACKERS] Disallowing multiple queries per PQexec() |
Список | pgsql-hackers |
Surafel Temesgen wrote: > I modified the patch as such and added to commitfest 2017-07. A couple comments: + {"disallow_multiple_queries", PGC_POSTMASTER, CLIENT_CONN_OTHER, + gettext_noop("Disallow multiple queries per query string."), + NULL + }, PGC_POSTMASTER implies that it's an instance-wide setting. Is is intentional? I can understand that it's more secure for this not to be changeable in an existing session, but it's also much less usable if you can't set it per-database and per-user. Maybe it should be PGC_SUSET ? + if ((strcmp(commandTagHead, "BEGIN") != 0) || (strcmp(commandTagTail, "COMMIT") != 0) ) + ereport(ERROR, + (errcode(ERRCODE_SYNTAX_ERROR), errmsg("cannot execute multiple commands unless it is a transaction block"))); Shouldn't ROLLBACK be considered too as ending a transaction block? Also, can it use a more specific code than ERRCODE_SYNTAX_ERROR? It feels more like a rule violation than a syntax error. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
В списке pgsql-hackers по дате отправления: