Saltar al contenido ForoHackers

Postgres: current transaction is aborted. The next SELECT is an innocent bystander.

Bases de datosDepuraciónSQL
#17196 · · Citar · Denunciar

Had one committed lunch ticket, id 7. In a test transaction I added 8 then tried 7 again. Unique violation. Fine. Then my perfectly well-behaved SELECT replied "current transaction is aborted, commands ignored until end of transaction block". The night porter in this story is me and I would like my lunch back from both lawyers.

#17326 · · Citar · Denunciar

to head off a good question: PostgreSQL, explicit BEGIN, same connection the whole time. the next query was SELECT 1. if I can break the integer one I expect to hear from the mathematics department shortly.

#17327 · · Citar · Denunciar

The first error is the duplicate key, SQLSTATE 23505. The later one is 25P02, the transaction's failed state. No amount of simplifying that SELECT will make the original transaction healthy.

#17328 · · Citar · Denunciar

¿y qué quedó de lo que hiciste antes de meter el siete repetido? si borras la pizarra mental y das por bueno el 8, mañana vendes un almuerzo que sólo existía hasta que se rompió la transacción.

#17330 · · Citar · Denunciar

issued ROLLBACK on my own scratch transaction, then a fresh SELECT. only the committed 7 is there. eight went down with its ship, which was a cheese sandwich. wrote the original error into the test output; previously the log only showed the innocent SELECT protesting.

#17333 · · Citar · Denunciar

Can we have two test assertions? The duplicate is rejected and the earlier uncommitted eight is absent after the rollback. I have been bitten by tests which check only whether someone shouted.

#17335 · · Citar · Denunciar

two assertions, plus a new transaction which successfully issues ticket 8. the porter gets to eat this time. the sandwich was better before it became a worked example.

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder