This is a migrated thread and some comments may be shown as answers.

[Postgresql] Problem with long sequence name

5 Answers 177 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Olivier
Top achievements
Rank 1
Olivier asked on 29 Oct 2013, 09:02 AM
Hello
I have problem for inserting new rows in many tables with long name.
In example, I have a table "parametreutilisateuretatparametre" with a primary key on a serial column "idparametreutilisateuretatparametre", Postgresql define the sequence name "parametreutilisateuretatparam_idparametreutilisateuretatpar_seq".
In OpenAccess, if I try to insert a row, I have an exception taht relation "parametreutilisateuretatparametre_idparametreutilisateuretatpar" doesn't exist.
I try to rename my sequence "parametreutilisateuretatparametre_pkey_seq", but I have the same error.
Why OpenAccess doesn't read the name of the sequence in the describe of the table ?
Have you a solution for my problem ?
Thanks in advance.



5 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 31 Oct 2013, 03:02 PM
Hi Arnaud,

 Thank you for the detailed description. I was able to reproduce the exception. The problem is with long table names. If the table name is beyond a certain length the parts of generated sequence name are truncated. Although we do read the sequence name while reading the schema, this name is not used while obtaining the generated sequence value. This is a bug and we will fix it.
I'm afraid I do not have a workaround at the moment apart from using a shorter table name.

I apologize for the inconvenience caused. 
Your Telerik points have been updated.

Regards,
Ady
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
0
Olivier
Top achievements
Rank 1
answered on 31 Oct 2013, 03:24 PM
Hi Ady
Thank for information.
I will try to rename my sequences with the same truncated name was you research and I hope I can't have 2 sequences with the same name.
Regards
0
Ady
Telerik team
answered on 31 Oct 2013, 03:29 PM
Hello Arnaud,

 If you rename the sequence to 'parametreutilisateuretatparametre_idparametreutilisateuretatparametre_seq' it will work.

Regards,
Ady
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
0
Olivier
Top achievements
Rank 1
answered on 31 Oct 2013, 03:57 PM
No, it's not possible because Postgres truncate automatically the name of the sequence
Example :
alter table parametreutilisateuretatparam_idparametreutilisateuretatpar_seq 
rename to parametreutilisateuretatparametre_idparametreutilisateuretatparametre_seq;

Postgres truncate the sequence : parametreutilisateuretatparametre_idparametreutilisateuretatpar

I will manually truncate with the name that OpenAccess try to find.
Thnaks
0
Ady
Telerik team
answered on 05 Nov 2013, 03:55 PM
Hello Arnaud,

 I did experience the problem that PostgreSql did truncate the sequence name when I edited it, but I was able to edit it it to 'parametreutilisateuretatparametre_idparametreutilisateuretatparametre_seq' by going ahead and saving the change. 
I used the pgAdmin tool.

Regards,
Ady
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Tags
Databases and Data Types
Asked by
Olivier
Top achievements
Rank 1
Answers by
Ady
Telerik team
Olivier
Top achievements
Rank 1
Share this question
or