<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:lionel@mamane.lu" title="Lionel Elie Mamane <lionel@mamane.lu>"> <span class="fn">Lionel Elie Mamane</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - Can't change Primary Key's name with Firebird Embedded db."
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=108068">bug 108068</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>lionel@mamane.lu
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>NOTOURBUG
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - Can't change Primary Key's name with Firebird Embedded db."
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=108068#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - Can't change Primary Key's name with Firebird Embedded db."
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=108068">bug 108068</a>
              from <span class="vcard"><a class="email" href="mailto:lionel@mamane.lu" title="Lionel Elie Mamane <lionel@mamane.lu>"> <span class="fn">Lionel Elie Mamane</span></a>
</span></b>
        <pre>From the Firebird 2.5 documentation:

 * It will not be possible to change the name of a column
   that is included in any constraint: PRIMARY KEY , UNIQUE
   key, FOREIGN KEY , column constraint or the CHECK constraint
   of the table.

 * Renaming a column will also be disallowed if the column
   is used in any trigger, stored procedure or view.


I agree this is unfortunate, but this needs to be enhanced / fixed in Firebird,
so is best tracked in the firebird bugtracker.

On the LibreOffice side, we could, to better work around this firebird
limitation, instead of trying to drop and recreate the column, try to drop the
primary key, change the name and create the primary key again. This would solve
this particular scenario, but there will always be other scenarios left.

Note the user can remove the primary key, then rename, then recreate the
primary key. Will work, but not good from a user-friendliness point of view.

(In reply to Julien Nabet from <a href="show_bug.cgi?id=108068#c1">comment #1</a>)
<span class="quote">> I noticed this on console:
> warn:connectivity.firebird:12867:1:connectivity/source/drivers/firebird/
> Statement.cxx:122: isc_dsql_execute failed
> warn:connectivity.firebird:12867:1:connectivity/source/drivers/firebird/Util.
> cxx:52: firebird_sdbc error:
> *unsuccessful metadata update
> *ALTER TABLE Table1 failed
> *action cancelled by trigger (1) to preserve data integrity
> *Cannot update index segment used by an Integrity Constraint
> caused by
> 'ALTER TABLE "Table1" ALTER COLUMN "ID"  TO "ID2"'</span >

We should show this error message to the user. Would give hir a hint how to
deal with the situation rather than the misleading "propose to drop/recreate
the column".</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>