Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #26105
| From | Emile van Sebille <emile@fenx.com> |
|---|---|
| Subject | Re: Generating valid identifiers |
| Date | 2012-07-26 11:10 -0700 |
| References | <50113768.6070008@shopzeus.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2620.1343326094.4697.python-list@python.org> (permalink) |
On 7/26/2012 5:26 AM Laszlo Nagy said... > I have a program that creates various database objects in PostgreSQL. > There is a DOM, and for each element in the DOM, a database object is > created (schema, table, field, index and tablespace). > > I do not want this program to generate very long identifiers. It would > increase SQL parsing time, and don't look good. Let's just say that the > limit should be 32 characters. But I also want to recognize the > identifiers when I look at their modified/truncated names. I had a similar problem with one customer where their legacy green screen app allowed only 40 characters max for the product description, but the marketing description lengths routinely ran out to 75 or so characters. In that situation I reviewed the source marketing descriptions and prepped a utility to translate common longer words or phrases to one of a selection of shortened abbreviations. I then cycled through best fitting substitutions to get as close as reasonable to the 40 character limit which generally resulted in recognizable descriptions in the legacy environment that matched by being directly derived from the longer marketing names. YMMV, Emile
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Generating valid identifiers Emile van Sebille <emile@fenx.com> - 2012-07-26 11:10 -0700
csiph-web