---
title: "ZSTD_COMPRESS"
description: "La fonction SQL ZSTD_COMPRESS compresse un BLOB \u00E0 l\u0027aide de l\u0027algorithme Zstandard."
language: fr
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/fr/docs/invantive-universalsql/grammar/sql-functions/zstd-compress
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/zstd-compress
updated: 2026-12-04T14:58:57Z
license: https://documentation.invantive.eu/fr/
---

## Syntaxe
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> ZSTD_COMPRESS[ZSTD_COMPRESS]:::quoted
    ZSTD_COMPRESS --> End((END))
```

## Objet
La fonction SQL `ZSTD_COMPRESS` compresse une image `blob` à l'aide de l'algorithme Zstandard.

Voir également [[ZSTD_DECOMPRESS]] et [[ZLIB_COMPRESS]].

Paramètres :
- Entrée (`blob`) : l'image `blob` à compresser.

Renvoie : une version compressée au format Zstandard de la donnée d'entrée.

## Exemples
L'exemple suivant compresse et décompresse les neuf caractères ASCII `ACME`, puis récupère le texte d'origine :
```sql
select blob_to_text(zstd_decompress(zstd_compress(ascii_to_blob('ACME'))))

-------------------
ACME
```
L'exemple suivant compresse un texte et récupère l'`blob` compressé, encodé en base64 :
```sql
select base64_encode(zstd_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpzdGQgY29tcHJlc3Npb24gbWV0aG9k'))

-------------------
KLUv/SA8vQEAwsMMFLAnHd2OTKNtYpi2ISYmwTDAZCECxao8IzN3TMax4dILZvUeu/Ui7ASy4iTxWPjMZwoIAA==
```

