This commit is contained in:
2025-10-12 18:20:29 +02:00
parent 51563e2dcd
commit 3ac174ed2b
5 changed files with 325 additions and 44 deletions

View File

@@ -3,14 +3,14 @@ DECLARE
r RECORD;
file_path TEXT;
BEGIN
FOR r IN SELECT id, caracteristiques FROM item
FOR r IN SELECT id, data FROM item
LOOP
file_path := format('/tmp/json/%s.json', r.id);
-- Écrit le fichier (nécessite superutilisateur)
PERFORM pg_catalog.pg_write_file(
PERFORM pg_write_file(
file_path,
r.caracteristiques::text,
r.data::text,
false -- false = écrasement (pas d'append)
);