Re: [HACKERS] Disallowing multiple queries per PQexec()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Disallowing multiple queries per PQexec()
Дата
Msg-id 10836.1497277977@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Disallowing multiple queries per PQexec()  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: [HACKERS] Disallowing multiple queries per PQexec()  ("Daniel Verite" <daniel@manitou-mail.org>)
Re: [HACKERS] Disallowing multiple queries per PQexec()  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes:
> 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 ?

Bearing in mind that I'm not really for this at all... why shouldn't
it be plain old USERSET?  AFAICS, the only argument for this restriction
is to make SQL injection harder.  But if an attacker is able to inject
a SET command, he's already found a way around it.  So there's no real
point in locking down the GUC to prevent that.

Also, generally speaking, GUCs should be phrased positively, ie this
should be named something more like "allow_multiple_queries" (with
opposite sense & default of course).

> +        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")));

I haven't read the patch, but surely looking at command tags is not
an appropriate implementation of anything in this line.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: [HACKERS] Disallowing multiple queries per PQexec()
Следующее
От: Joe Conway
Дата:
Сообщение: Re: [HACKERS] PG10 Partitioned tables and relation_is_updatable()