Skip to content

omni_csv

CSV toolkit

omnigres · CSV toolkit

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2946omni_csvomnigres0.1.1FEATApache-2.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.1.119 18 17 16 15omnigres-
RPMPIGSTY2026021219 18 17 16 15omnigres_$vpostgresql$v-contrib, postgresql$v-plpython3, python3-pip
DEBPIGSTY2026021219 18 17 16 15postgresql-$v-omnigrespostgresql-plpython3-$v, python3-pip
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el8.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el9.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el9.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el10.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el10.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d12.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d12.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d13.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d13.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u22.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u22.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u24.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u24.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u26.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u26.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212

Source

pig build pkg omnigres;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install omnigres;		# install by package name
pig install omni_csv;		# install by extension name

pig install omni_csv -v 18;   # install for PG 18
pig install omni_csv -v 17;   # install for PG 17
pig install omni_csv -v 16;   # install for PG 16
pig install omni_csv -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION omni_csv;

Usage

omni_csv: CSV toolkit

The omni_csv extension provides CSV parsing, inspection, and generation functions.

Inspect CSV Structure

SELECT * FROM omni_csv.csv_info(E'name,age,city\nJohn,25,NYC\nJane,30,LA');
-- Returns: name, age, city (one row per column)

Parse CSV into Records

SELECT * FROM omni_csv.parse(E'name,age,city\nJohn,25,NYC\nJane,30,LA')
    AS t(name text, age text, city text);

Column structure must be specified using the AS t(...) clause and should match the CSV structure.

Generate CSV from Query Results

SELECT omni_csv.csv_agg(t)
FROM (SELECT name, age, city FROM employees ORDER BY name) t;

Returns CSV text with headers and properly escaped values. Returns empty string on empty result sets.

Limitations

  • Large CSV strings are processed entirely in memory (no streaming)
  • Column types must be declared in the AS t(...) clause
  • Consider materializing parsed data for repeated access

Table reader