Thanks to Ron Bruder who left a comment on the previous post with the link directly to the documentation for using the PostGIS geometries in the geodatabase. I did have some weirdness trying to access the link - of course you'll need to login because it's still beta documentation, but even after, that I'd see the page, and then it would jump me back to the login screen. I was able to access it by saving the link to Html and then viewing it. Moving on...
The ArcSDE doc says that to store data in PostGIS format, you need to create the "database" (presumably the "sde" database) using the postgis template, then create the sde user and sde schema before running the post install. Ok. Since I'd already done this, I dropped the sde database, then re-created it as per the instructions and... yeah.
So the post install failed. It did handily suggest looking at some logs buried away in the sde folder tree, and low the log did have a handy little gem:
db_table_grant_access: Grantee public does not have USAGE permission on schema sde.
Ok. Back into Navicat, grant USAGE to Public on the sde schema, and the post installer is completed. While my end goal is to use Direct Connect, to start, I'm just going to run the SDE service until I know everything else is working.
The next step is to get ArcGIS to use the PostGIS format. For this you need to edit the "dbtune file". From past experience with ArcSDE on SQL Server, I thought that "dbtune" was now a table, and it's a whole lot easier to edit a table than fiddle with the dbtune export/import mess. So, I simply updated the GEOMETRY_STORAGE parameter in the DEFAULTS section of the SDE_DBTUNE table to be "PG_GEOMETRY". So now I should be able to use ArcGIS Desktop to edit / manage data in PostGIS, while still accessing the data as native PostGIS format for say GeoServer and uDig.
I used the standard Import feature in ArcCatalog, and this worked smoothly. I then fired up uDig to see if it would show up a native PostGIS layer... yep... along with all the other tables in the sde schema. I think that there are likely better ways to organize your data, so this is likely not a "real" issue.
I had some issues applying a thematic renderer to the layer - for some reason it would only apply the renderer to the vectors. When I looked at the SLD xml, everything was setup as a <sld:LineSymbolizer>... since it looks fine in ArcMap (see below), and the original shapefile loads into uDig as polygons, this may be an "beta" issue. Ordinarily I'd check the beta forums right now, but I'm writing this at 38575ft en route to Where 2.0, so that will have to wait.
Loading data via ArcSDE into ArcMap works very smoothly.
And after telling ArcMap to let me edit "unversioned" data, I could edit as usual. uDig says I can't edit the layer. Being really new to this whole stack, I'm not sure if it's permissions (although I connect as the same identity in ArcMap), or a limitation (heck - I don't even know if uDig can edit vanilla PostGIS layers!)
I also wanted to try a direct connection - I stopped the ArcSDE service. Worked just fine - note the "service" name.
I've got a few other things I want to mess with, but I've got the basics working. It's been a few miss-steps but not too bad once I read the documentation. Although I've been using ArcSDE on SQL Server for a long time, it's definitely worth reading the docs when setting this up. Clearly I'd need to do more digging on optimizing the database structure, permissions and other sundry tuning things, but if you are looking to trade some time learning PostgreSQL for the $$$ involved buying Oracle or SQL Server, it's pretty compelling. I can't say much about performance as this is just one small layer (US Counties) running on my notebook. I do know people who are running some big databases on PostgreSQL + PostGIS (like millions of spatial features in a layer) and they've got it blazing.
I'm Dave and this is my blog. I'm usually writing about .NET Software Development, ArcGIS, or Agile Practices, but other stuff does creep in from time to time. I hope you find something of use, and feel free to contact me if you have any questions. You can also check out my profile on LinkedIn
dojo.DTSAgile.com is our technology preview / demo site. As I and my team cook up cool things we post them here.
ArcDeveloper.net is a site that hosts a set of open source projects related to ArcGIS. This includes Tile Cache for .NET (TC4N) and Feature Server for .NET (FS4N). Come over and check it out!
Assembla is a free service that provides Subversion source control, wikis and work Tracking. The ArcDeveloper project is run from here. It rocks. Check them out today.
Agilistas is a LinkedIn group focused on discussing and promoting Agile practices. Everyone is welcome to join in the conversation as we evolve the process of creating software to make it more enjoyable for all involved.