Writing a string longer than STRING[n] into a data property: a single value is silently cut, a set-based write fails with a raw PostgreSQL "value too long" error
@danchanka is already working on this.
Since Oct 16, 2026.
Assessment
This issue has not been assessed yet.
Description
Description
A string value longer than the length of the target STRING[n] / ISTRING[n] data property is handled differently depending on how it is written:
- a single value — a parameterless property, or one object given as a value — is cut to
ncharacters without any message; - a write over a set of objects — an assignment with parameters, a
FORmerged into one change, or one constant writtenWHEREto several objects — is not cut. It fails with the PostgreSQL errorvalue too long for type character varying(n): at the assignment when the value is computed per row, or later atAPPLYwhen one constant is written to several objects (the session keeps the uncut value until then).
The explicit conversion STRING[n](...) cuts the value to n characters.
Reproducer (platform 7.0-SNAPSHOT, PostgreSQL 18, run through /eval):
s5 = DATA LOCAL STRING[5] ();
s5k = DATA LOCAL STRING[5] (INTEGER);
p = DATA LOCAL STRING[4] (INTEGER);
q = DATA LOCAL STRING[4] (INTEGER);
run() {
s5() <- 'abcdefgh'; // 'abcde' - cut
s5k(1) <- 'abcdefgh'; // 'abcde' - cut
s5k(INTEGER i) <- 'abcdefgh' WHERE iterate(i, 1, 3); // s5k(1) reads back as 'abcdefgh' - 8 characters kept in the session
p(INTEGER i) <- 'abcd' WHERE iterate(i, 1, 3);
q(INTEGER i) <- 'efgh' WHERE iterate(i, 1, 3);
s5k(INTEGER i) <- p(i) + q(i) WHERE iterate(i, 1, 3); // ERROR: value too long for type character varying(5)
EXPORT FROM a = s5(), b = s5k(1);
}
With a stored property (name = DATA ISTRING[100] (Item)):
probeNew = DATA LOCAL BOOLEAN (Item);
run() {
NEWSESSION {
NEW a = Item { probeNew(a) <- TRUE; }
NEW b = Item { probeNew(b) <- TRUE; }
name(Item i) <- '<101 characters>' WHERE probeNew(i); // passes: the session reads the name back with length 101
APPLY; // ERROR: value too long for type character varying(100)
}
}
and name(Item i) <- '<101 characters>' + STRING(i) WHERE probeNew(i); fails already at the assignment with the same error.
Expected: one rule for every write, independent of whether the value goes to one object or to a set — either the value is cut to n the way the explicit conversion cuts it, or the write is rejected with a platform error that names the property and the length instead of a database error.
Fix
Either apply the conversion to the declared string class in the set-based write path (session table and apply), the way it is applied to a single value and by the conversion operator, or check the length in both paths and raise a platform error naming the property.
Reason
A single value is read into memory and converted to the property's class before it is stored; a set-based change is written by a database query into a session table — and at apply into the stored table — whose column has the declared length, without any conversion, so the database rejects the row. The two paths were never aligned, and the error that reaches the developer is the raw database message.
- Dominant language
- Java
- Stars
- 214
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lsfusion/platform
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
All issues in lsfusion/platform
Similar issues
-
account assessment course feature lecture
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
app:learninggoalhub enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPossibly taken @vaibhavgupta443 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1991 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100