AyoubKaz07 opened a new issue, #2449:
URL: https://github.com/apache/age/issues/2449
**Describe the bug**
Both functions rely on Postgres's COPY command, `ag_load_labels.c` and
`ag_load_edges.c` share an identical `create_copy_options()` that only passes
two options to `BeginCopyFrom` (header and format, everything else is default
from Postgres).
`load_labels_from_file` with a pipe-delimited multi-column label CSV file
silently corrupts data (correctly since default is comma). The entire line is
read as a single field, column names get merged with values into one token, and
the result lands in properties as garbage with no error:
```pgsql
id | properties
----------+---------------------------------------------
... | {"__id__": 1, "id|islocatedin_city": "1|5"}
```
`load_edges_from_file` with a pipe-delimited file crashes the server. The
4-column edge format requires `start_id, start_vertex_type, end_id,
end_vertex_type` as separate fields. A quick lookup on it shows that with no
comma splitting, fields[1] through fields[3] are null, `process_edge_row` calls
`trim_whitespace(fields[1])` on a bad pointer, and the server segfaults.
The documentation mentions no delimiter requirement. The example files use
comma but this is never stated as a constraint. The header row is handled
manually in the loop rather than by COPY itself `(HEADER false)`, so the
parsing feels custom, which makes it even less obvious that COPY's delimiter
default is silently in effect underneath.
**How are you accessing AGE (Command line, driver, etc.)?**
- psql
**What is the command that caused the error?**
```pgsql
SELECT load_labels_from_file('graph', 'Label', '/derived/Label.csv'); -- No
error, just incorrect parsing.
SELECT load_edges_from_file('graph', 'SomeEdge', '/derived/SomeEdge.csv');
-- This segfaults
```
```
026-06-29 19:25:56.972 GMT [1] LOG: client backend (PID 64) was terminated
by signal 11: Segmentation fault
2026-06-29 19:25:56.972 GMT [1] DETAIL: Failed process was running: SELECT
load_edges_from_file('graph', 'SomeEdge', '/derived/SomeEdge.csv');
2026-06-29 19:25:56.972 GMT [1] LOG: terminating any other active server
processes
```
**Expected behavior**
Depends really, either have a delimiter option just like postgres COPY
command options or clarify in documentation + correct error if comma only
(instead of segfaulting).
**Environment (please complete the following information):**
- apache/age docker image.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]