omni_csv
CSV toolkit
Repository
https://docs.omnigres.org/omni_csv/
https://docs.omnigres.org/omni_csv/
Source
omnigres-20251108.tar.gz
omnigres-20251108.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
omni_csv | 0.1.1 | FEAT | Apache-2.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2946 | omni_csv | No | Yes | No | Yes | No | No | omni_csv |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 | 1817161514 | omni_csv | - |
| RPM | PIGSTY | 0.1.1 | 1817161514 | omnigres_$v | - |
| DEB | PIGSTY | 0.1.1 | 1817161514 | postgresql-$v-omnigres | - |
Build
You can build the RPM / DEB packages for omni_csv using pig build:
pig build pkg omni_csv # build RPM / DEB packages
Install
You can install omni_csv directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install omni_csv; # Install for current active PG version
pig ext install -y omni_csv -v 18 # PG 18
pig ext install -y omni_csv -v 17 # PG 17
pig ext install -y omni_csv -v 16 # PG 16
pig ext install -y omni_csv -v 15 # PG 15
pig ext install -y omni_csv -v 14 # PG 14
dnf install -y omnigres_18 # PG 18
dnf install -y omnigres_17 # PG 17
dnf install -y omnigres_16 # PG 16
dnf install -y omnigres_15 # PG 15
dnf install -y omnigres_14 # PG 14
apt install -y postgresql-18-omnigres # PG 18
apt install -y postgresql-17-omnigres # PG 17
apt install -y postgresql-16-omnigres # PG 16
apt install -y postgresql-15-omnigres # PG 15
apt install -y postgresql-14-omnigres # PG 14
Create Extension:
CREATE EXTENSION omni_csv;
Usage
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
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.