0

I am using ArcGIS Pro and connecting to a PostgreSQL database. I have enabled the database as Enterprise Geodatabase and it automatically creates a user "sde" for my PostgreSQL database. Then I want to register a table with the geodatabase. The owner is shown as the following image

enter image description here

And I am connecting to the database with user "sde", which is automatically created in the previous step

enter image description here

However, I still get error "ERROR 001400: Only the data owner may execute register with geodatabase".

So I am little confused about how to execute the "Register With Geodatabase" as a data owner? Am I using the correct way to login as the data owner?

5
  • Just to be sure, that table was created by the sde user? Does it say sde.ecofield in the catalog window?
    – Berend
    Commented May 28 at 20:06
  • The database name is "ecofield.sde", and the table name is "ecofield.shape_test.counties". Because it is a PostreSQL connection, I believe "shape_test" is the schema name, and the "counties" is the table name. How can I check the owner of a table.? The first image I upload shows the owner of the enterprise connection. Would it happens that the table's owner is not the same as the database owner?
    – kgs-tliu
    Commented May 28 at 20:17
  • In that case, it looks like shape_test is the schema / owner. Can you login as shape_test?
    – Berend
    Commented May 28 at 20:36
  • But "shape_test" is a schema, there is no password for it. I cannot login with a username: "shape_test"
    – kgs-tliu
    Commented May 28 at 20:52
  • Yes, you are right. The owner should be shape_test. Just I am quite new to GIS, it was hard for me to understand to login as a schema. Thanks for your solution
    – kgs-tliu
    Commented May 29 at 14:36

1 Answer 1

1

Your Question and comment confuse several issues. PostgreSQL has logins (technically, login roles1) which are used to connect to an instance (host+port). The sde login is used to manage the geodatabase. sde should never own spatial data, much the way you should not use the postgres login for anything but administering the instance.

PG instances also have databases. You should always create a new database for spatial data (do not use postgres or any template database). The database name for a geodatabase cannot be "ecofield.sde" (forbidden "." character in name -- all names must be SQL standard compliant2 AND must be lowercase). You may be confusing the database name with the connection file (which is a binary file with a .sde suffix).

Logins map to schemas, which are, in effect, users in the database3. To eliminate the ambiguity, ArcGIS requires that any login which will create data through ArcGIS tools must have the same schema name as login name (and both must be lowercase). The Create Database User tool can be used to generate login/schema pairs in the way that ArcGIS expects, but it isn't required.

You cannot use the sde login to register any tables not owned by sde (which, to be clear, should not exist). So, while the sde user may own the database, it is not the "data owner" (that's what the login/schema pairs are for).

In order to register data owned by schema shape_test with ArcGIS, you must have a login named shape_test (and I think it's required to be password-protected; it certainly should be), which is the authorization to schema shape_test, and a connection file which connects to database ecofield in instance localhost:5432. Then you can connect as this user, and right-click Register the table.


1 There are also group roles (aka "groups") which are... complex, because they can own objects, in addition to being used to GRANT permissions, but I'm going to avoid that rabbit hole now.

2 ISO SQL Standard names are those that start with an alpha (formerly "Latin a-z", but now UTF letter codepoints), and have zero, one or more alphanumeric (+ 0-9) or underscore (_) characters (they also cannot be reserved names -- You can't name your table "select"). ISO names are case-independent, which are mapped to lower-case in PostgreSQL (they're UPPERCASE in Oracle). Most RDBMS vendors, PostgreSQL included, allow for non-standard naming (including MiXedCase, punctuation, and spaces), but to do so, the name must be surrounded by quotes (") each and every time it is referenced (e.g., "ecofield.sde"). The pain of having to explicitly format every single non-compliant name is significant, and spread among any who use your database (who won't be ArcGIS users, because it does not honor quotes, and the names will not be found, and therefore unusable).

3 Schemas are used to reference objects within a database. They're another source of complexity, because roles "own" tables, which are referenced by schema, and schemas are authorized by roles, and can have USAGE granted to other roles.

3
  • 1
    The easiest way is usually to have ArcGIS create a user, it will automatically create a schema with the same name, and set proper privileges for the user. I don't know what happens if the schema already exists, though.
    – Berend
    Commented May 29 at 5:32
  • Your answer is probably right when it comes to how ArcGIS is made to work with PostgreSQL. Genarally speaking the name of the database in PostgreSQL can be "ecofield.sde", even it is a bad idea stackoverflow.com/questions/58520530/…. And schemas are not "users in a database" postgresql.org/docs/current/ddl-schemas.html "Unlike databases, schemas are not rigidly separated: a user can access objects in any of the schemas in the database they are connected to, if they have privileges to do so."
    – user30184
    Commented May 29 at 6:11
  • Oh, it works!! Thank you very much for your detailed instruction. After creating a user "shape_test" and set proper permission, I am able to register the table with geodatabase. I was confused with concept of database user, geodatabase owner, data owner... But I am kind of understand now. Thanks again for your explanation
    – kgs-tliu
    Commented May 29 at 14:35

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