Re: Generating valid identifiers

Discussion in 'Python' started by Emile van Sebille, Jul 26, 2012.

  1. 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
     
    Emile van Sebille, Jul 26, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    369
    Roedy Green
    Apr 22, 2008
  2. Laszlo Nagy

    Generating valid identifiers

    Laszlo Nagy, Jul 26, 2012, in forum: Python
    Replies:
    8
    Views:
    295
    Laszlo Nagy
    Jul 27, 2012
  3. Arnaud Delobelle

    Re: Generating valid identifiers

    Arnaud Delobelle, Jul 26, 2012, in forum: Python
    Replies:
    0
    Views:
    208
    Arnaud Delobelle
    Jul 26, 2012
  4. Terry Reedy

    Re: Generating valid identifiers

    Terry Reedy, Jul 26, 2012, in forum: Python
    Replies:
    0
    Views:
    209
    Terry Reedy
    Jul 26, 2012
  5. Peter Otten

    Re: Generating valid identifiers

    Peter Otten, Jul 26, 2012, in forum: Python
    Replies:
    0
    Views:
    160
    Peter Otten
    Jul 26, 2012
Loading...

Share This Page