Re: Is this legal SQL? Is it a good practice?
От | Tom Lane |
---|---|
Тема | Re: Is this legal SQL? Is it a good practice? |
Дата | |
Msg-id | 13002.1093388250@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Is this legal SQL? Is it a good practice? (Carlos Moreno <moreno@mochima.com>) |
Список | pgsql-general |
Carlos Moreno <moreno@mochima.com> writes: > I always thought the semicolon was a psql thing, > which it would use to determine when the user is > done entering the SQL statement. Exactly. psql parses what you type sufficiently well to locate command-ending semicolons, and then sends one command at a time to the backend. libpq is much dumber; it just takes the string you give it and ships that to the backend. The backend's current behavior with multi-command input strings has been that way since the beginning (or at least since before I got here). People have occasionally proposed removing the feature, but it's pretty well entrenched on backwards-compatibility grounds. Note that the new "v3" fe/be protocol does *not* allow multiple commands in an extended-query-mode input string, so if you are of the opinion that allowing multiple commands is a bad idea you can just use extended query mode all the time. (In libpq that translates to not using PQexec, but one of the newer functions.) regards, tom lane
В списке pgsql-general по дате отправления: