Skip to content
Saturday, August 8, 2026

El Lupanar de Dieguito

Atendido por su dueño.

  • Home
  • Ingresar
  • Registrarse
  • DAF URL Gen
  • DAF ANONYMIZER
  • Acerca de la magia…
  • Mi GitHub
  • Contactame

DELETE con LIMIT en Postgres

Posted on 2019/10/042019/10/07 by Don Diego Puramagia

Sucio y desprolijo:

WITH cte AS (

SELECT my_rowid /* your PK */
FROM batch
WHERE bat_close_time_stamp <= 1507381943.93144 /* your condition */
/* ORDER BY ??? */ /* optional */
LIMIT 500
FOR UPDATE /* SKIP LOCKED */

)
DELETE FROM batch tbl
USING cte
WHERE tbl.my_rowid = cte.my_rowid;

Fuente: stackoverflow.com/questions/52950430/batch-delete-in-postgres-using-a-cursor

Posted in PostgreSQL

Post navigation

Previous: Changing the Auto-Logout Timeout in SSH
Next: Archivos del Garmin

Related Posts

  • PostgreSQL

DATAZO IV – Modulo PG_TRGM

  • Don Diego Puramagia
  • 2016/11/07
  • 0

La única función que analice de acá fue la “similarity”. En XXXX la estamos usando para buscar PABLO PEREZ o PEREZ PABLO, independientemente como lo […]

  • PostgreSQL

Actualizando registros desde SQL Server 2012 a Postgres 9.2 via Linked Server

  • Don Diego Puramagia
  • 2013/10/24
  • 0

Al ejecutar una consulta dentro de una transacción distribuida como la siguiente se presenta un error 8522, esto se debe a que en la configuración […]

  • PostgreSQL

Primary Key Index is a Space Hog

  • Don Diego Puramagia
  • 2020/04/06
  • 0

Tables in PostgreSQL have an index for the primary key and separate row storage called the heap. Other databases integrate these together or support “index-organized […]

Copyright © 2026 El Lupanar de Dieguito Theme: Terminal News By Adore Themes.