Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
От | Jim Nasby |
---|---|
Тема | Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless) |
Дата | |
Msg-id | ce7ac5bd-9b62-80e2-283d-973b0b72ed56@BlueTreble.com обсуждение исходный текст |
Ответ на | Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless) (Corey Huinker <corey.huinker@gmail.com>) |
Ответы |
Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
|
Список | pgsql-hackers |
On 2/2/17 4:39 PM, Corey Huinker wrote: > > On Wed, Feb 1, 2017 at 4:58 PM, Jim Nasby <Jim.Nasby@bluetreble.com > <mailto:Jim.Nasby@bluetreble.com>> wrote: > > I think the issue here is that the original case for this is a user > accidentally getting into an \if and then having no clue what's > going on. That's similar to what happens when you miss a quote or a > semicolon. We handle those cases with %R, and I think %R needs to > support if as well. > > Perhaps there's value to providing more info (active branch, etc), > but ISTM trying to do that will just confuse the original (%R) case. > > > Jim, > > After spending a few minutes to familiarize myself with %R, I'm in > agreement with your second statement (adding if-else to %R will just > confuse %R). However, your first statement seems to indicate the > opposite. Can you elaborate? My point was that we need a way for users to know if they're stuck in an \if block, and right now that's handled with %R (inside transaction, parens, etc). My other point is that adding all the extra info to %R would be folly. Since the current consensus is to be very verbose about \if, this is obviously a non-issue. Maybe worth adding a 'I' case to %R, but no big deal if that doesn't happen. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532)
В списке pgsql-hackers по дате отправления: