ROLLBACK syntax error in pgadmin4
От | Malik Rumi |
---|---|
Тема | ROLLBACK syntax error in pgadmin4 |
Дата | |
Msg-id | CAKd6oBx3igGu=DX3zCqAbLi6FL068hv3LAH-1ySjBSgJvSrsuQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: ROLLBACK syntax error in pgadmin4
(Melvin Davidson <melvin6925@yahoo.com>)
|
Список | pgadmin-support |
<div dir="ltr">I am using PGAdmin4 with PG 9.4 on Ubuntu 16.04 64 bit. I wanted to do an update, but was unsure of the result,so I unselected autocommit and ran explain. It said only one row was affected, which I didn’t understand, becauseit should have affected at least 2. Then I inferred that the ‘one row’ being referred to was the plan, not the rowsin my data. <p class="gmail-western" style="margin-bottom:0in;line-height:100%"><p class="gmail-western" style="margin-bottom:0in;line-height:100%">ThenI ran the update, again no autocommit, and it was not what I expected. Sothen I added ROLLBACK to the end of the query, ran it again, and got this error:<p class="gmail-western" style="margin-bottom:0in;line-height:100%;margin-left:40px">ERROR:syntax error at or near "ROLLBACK" LINE 1: ...de" SET childof_id= NULL WHERE codelevelsortseq=1 ROLLBACK;<p class="gmail-western" style="margin-bottom:0in;line-height:100%">Ithen did a new query, with just ROLLBACK; as I see it explained with an examplein the docs: <a href="https://www.postgresql.org/docs/9.4/static/sql-rollback.html">https://www.postgresql.org/docs/9.4/static/sql-rollback.html</a><p class="gmail-western"style="margin-bottom:0in;line-height:100%">Nevertheless, I got the same error:<p class="gmail-western"style="margin-bottom:0in;line-height:100%;margin-left:40px">ERROR: syntax error at or near "ROLLBACK"LINE 1: ...F, VERBOSE ON, COSTS ON, BUFFERS OFF, TIMING OFF) ROLLBACK;<br />Note in this case ROLLBACK; is theonly thing on Line 1. The error carat (^) is pointing at the R in both cases. No other queries have been run in the interim.<p class="gmail-western" style="margin-bottom:0in;line-height:100%">To my surprise, there are very few Google hitsfor this exact search: <p class="gmail-western" style="margin-bottom:0in;line-height:100%;margin-left:40px">"syntax errorat or near 'ROLLBACK'" About 30 results (0.34 seconds) <p class="gmail-western" style="margin-bottom:0in;line-height:100%">Thefirst two hits are for a bug report from Nov. of 2006, which was fixed thenand there. I don’t think this is the same bug, if it is a bug. <p class="gmail-western" style="margin-bottom:0in;line-height:100%">Idid find DISCARD in the docs: <a href="https://www.postgresql.org/docs/9.4/static/sql-discard.html">https://www.postgresql.org/docs/9.4/static/sql-discard.html</a> however,I have not run it because I wanted some clarity here and didn’t want to interfere with my ROLLBACK, if it would evenhave that effect.<p class="gmail-western" style="margin-bottom:0in;line-height:100%">So, my questions:<p class="gmail-western"style="margin-bottom:0in;line-height:100%">1. How do I discard this update and get my data back?<p class="gmail-western"style="margin-bottom:0in;line-height:100%">2. How do I check to make sure it really isn’t committedwithout upsetting my ROLLBACK options? (Yes, I do have a backup I can go to, but I would rather understand whatis happening and fix it).<p class="gmail-western" style="margin-bottom:0in;line-height:100%">4. If it isn’t committed,and this is a bug, can I just close PGAdmin4 and/or PG and discard the changes that way?<p class="gmail-western"style="margin-bottom:0in;line-height:100%">5. Is this a new, different bug?<p class="gmail-western"style="margin-bottom:0in;line-height:100%">6. What was that 'one row effected' about?<br /></div>
В списке pgadmin-support по дате отправления:
Предыдущее
От: Kieran McCuskerДата:
Сообщение: PgAdmin4 not usable when installed from RPMs on Fedora linux