Caveats for altering field length via pgAdmin?

170
4
06-04-2019 01:39 PM
MichaelSnook
Occasional Contributor III

Is there any danger in altering a field length in a PostGres DB using pgAdmin? 

I was able to successfully alter both the main table as well as the adds table column name but I'm wondering if there are any possible ramifications concerning versioning etc?  Thanks for any info in advanced!

Mike

0 Kudos
4 Replies
ColinWerle1
Esri Contributor

Hi Mik,

Typically it is not recommended to follow this workflow because of the version view table. A possible workaround could be to un-register it as versioned in ArcMap, and use the field properties dialog box to change the field length, then re-register it as versioned again.

Best,

Colin

MichaelSnook
Occasional Contributor III

Thanks Colin

Will this work if the column is populated with data?

Mike

0 Kudos
ColinWerle1
Esri Contributor

Mike,

I just did some brief testing. What I found was that I am able to increase the field length when the table is unregistered as versioned, however, if I tried to decrease the field length I would be prompted with a "table or feature class is not empty" error.

Colin

Asrujit_SenGupta
MVP Regular Contributor

Expected documented behavior: Modifying field properties—ArcGIS Help | ArcGIS Desktop 

Length

If your table or feature class does not contain data, you can increase or decrease this value. If your table or feature class contains data, you can only increase the field length.

Also, you can alter the field length, even when the data is Versioned. You don't need to Unregister as Versioned, to alter the field length.

FAQ: What schema changes can be made to versioned data? 

0 Kudos