Re: Fetch zero result rows when executing a query?
От | Stephen R. van den Berg |
---|---|
Тема | Re: Fetch zero result rows when executing a query? |
Дата | |
Msg-id | 20150204111352.GB25788@cuci.nl обсуждение исходный текст |
Ответ на | Fetch zero result rows when executing a query? (Shay Rojansky <roji@roji.org>) |
Ответы |
Re: Fetch zero result rows when executing a query?
|
Список | pgsql-hackers |
Shay Rojansky wrote: >I'm working on the Npgsql, the .NET driver for PostgreSQL, and am trying to >find a way to execute a query but without fetching any rows. The Execute >message has a maximum result-row count, but zero is documented to mean >"fetch all rows". >The use case would be sending a query which might modify or might not (e.g. >UPDATE), but we know that the user is uninterested in any result row. >My current workaround is to specify maxrows=1, was wondering if I missed a >better alternative. If you know beforehand the query generates at most one row, then specifying maxrows=0 is best. If you know beforehand the query might generate more than one row (SELECT) yet you also know that you are not interested in those, then maxrows=1 is best; then again, modifying the query to include a LIMIT 1 is even better, in which case maxrows can be zero again. maxrows=1 for UPDATE/DELETE/INSERT does not make sense, use maxrows=0. -- Stephen.
В списке pgsql-hackers по дате отправления: