[Postgresql] Problem with long sequence name

6 posts, 0 answers
  1. Arnaud
    Arnaud avatar
    25 posts
    Member since:
    Jan 2013

    Posted 29 Oct 2013 Link to this post

    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.



  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 31 Oct 2013 Link to this post

    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!
  3. DevCraft banner
  4. Arnaud
    Arnaud avatar
    25 posts
    Member since:
    Jan 2013

    Posted 31 Oct 2013 Link to this post

    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
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 31 Oct 2013 Link to this post

    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!
  6. Arnaud
    Arnaud avatar
    25 posts
    Member since:
    Jan 2013

    Posted 31 Oct 2013 Link to this post

    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
  7. Ady
    Admin
    Ady avatar
    588 posts

    Posted 05 Nov 2013 Link to this post

    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!
Back to Top
DevCraft banner