1

At QGIS 3.34.6, I am unable to rename feature classes or attribute tables using the Browser Panel. Here's the procedure that I've tried:

  1. From the Browser Panel, open a File Geodatabase by clicking the expand icon.
  2. Right-click a feature class or attribute table and drop down to Manage
  3. At this point, the only option is Delete. Normally I would expect a Rename option.

So... How do I rename a File Geodatabase feature class or table?

EDIT:

Using the suggestion by User2856, I get the following error:

virtual: Query execution error on CREATE TEMP VIEW _tview AS ALTER TABLE "county_boundary" RENAME TO "county_boundary_2": 1 - near "ALTER": syntax error
Execution failed after 0.26 seconds

Here are my steps (GDAL version = 3.8.5):

  1. From the Layers panel, highlight the FGDB feature class to be renamed (in this example, county_boundary)
  2. Processing > Toolbox > Vector general > Execute SQL
  3. Within the tool's SQL data entry box, enter the following: ALTER TABLE "county_boundary" RENAME TO "county_boundary_2"
  4. All other data entry boxes were left empty

I don't understand the error. Any thoughts?

1 Answer 1

2

It doesn't appear that you can yet. With the GUI that is.

However, if your GDAL version is >= 3.6 (when write/create was added to the OpenFileGDB driver), you can rename with SQL:

Check GDAL version:

enter image description here

In the Browser pane, right-click the feature class and select "Execute SQL".

enter image description here

Use the following SQL syntax ALTER TABLE "oldname" RENAME TO "newname":

enter image description here

Result:

enter image description here

Or you can use the commandline GDAL ogrinfo utility with the same SQL:

ogrinfo input.gdb -sql "ALTER TABLE oldname RENAME TO newname"
3
  • Please see my OP edits. Any help is appreciated!
    – Stu Smith
    Commented May 18 at 16:56
  • @StuSmith the method you mention won't work. See my edit and use the Browser pane to rename.
    – user2856
    Commented May 18 at 22:08
  • Ah yes! The sql is done from the Browser panel, not the Layer panel. Presto!
    – Stu Smith
    Commented May 19 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.