-
1. Re: TEIID 30357 nextval does not exist
shawkins Jun 8, 2018 2:27 PM (in response to cm.kumar)What is the user sql you are issuing?
If the id column in the database has the default value set to the sequence, then you should just omit the id column from your insert.
If you need access to the sequence, it can be modeled as a function or imported automatically as one in Teiid 10.0+ [TEIID-1131] Document/expand sequence support - JBoss Issue Tracker
-
2. Re: TEIID 30357 nextval does not exist
cm.kumar Jun 11, 2018 5:22 AM (in response to shawkins)Hello Steven,
Even if I don't use the nextval column for insert, the error is thrown out as such.
Attached VDB used and error log.
The approach I used to insert the data is using http 'POST' method,
Body -
{
"collection_id":4,
"config_name":"testsummary",
"user_id":"user1",
"config_value": "test"
}
My postgres table for app_user_config is like,
CREATE TABLE public.app_user_config
(
id integer NOT NULL DEFAULT nextval('app_uc_1_id_seq'::regclass),
config_name character varying(255) NOT NULL,
config_value text NOT NULL,
collection_id integer,
user_id character varying(255) NOT NULL,
user_config_key character varying(255),
CONSTRAINT uc_id PRIMARY KEY (id),
CONSTRAINT uc_cname_user UNIQUE (config_name, user_id)
)
Regards,
Chandra
-
DSPIConfig.1-vdb.xml.zip 1.9 KB
-
ErrorPostUserConfig.txt.zip 2.8 KB
-
-
3. Re: TEIID 30357 nextval does not exist
shawkins Jun 11, 2018 8:18 AM (in response to cm.kumar)It looks like eclipselink is sitting over teiid and has been configured to use a sequence identity generator. [TEIID-5074] Support a way provide SEQUENCE in TeiidDialect - JBoss Issue Tracker together with the changes from TEIID-1131 make that work automatically when using hibernate and the major databases that support sequences. But the automatic support is not there yet for eclipselink. Given that your platform has been configured to expect a stored procedure by the name of nextval, you could create one on your postgresql model:
create foreign procedure nextval (seq_name string) returns long options ("teiid-rel:native-query" 'select nextval($1)')
-
4. Re: TEIID 30357 nextval does not exist
cm.kumar Jun 12, 2018 7:32 AM (in response to shawkins)Thanks. At least i'm able to get the sequence next number and pass it on.
-
5. Re: TEIID 30357 nextval does not exist
shawkins Jun 12, 2018 10:40 AM (in response to cm.kumar)Please capture an issue if there is way to build in better sequence handling to our eclipse link TeiidPlatform.