PostgreSQL Alias Name Length

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Kratzer

    PostgreSQL Alias Name Length

    Hi...

    I am currently working on a Java-based product that is backed by
    PostgreSQL (among other databases).

    I have noticed that PostgreSQL appears to truncate column alias names
    after 31 characters. I have replicated this through JDBC (in Java),
    PEAR (in PHP), and on the command-line interface (psql).

    For example (this is from the psql command-line tool):

    SELECT rss_headline_id as abcdefghijklmno pqrstuvwxyz1234 56, title, url
    FROM news_rss_headli nes headlines WHERE rss_headline_id = 22833;
    NOTICE: identifier "abcdefghijklmn opqrstuvwxyz123 456" will be
    truncated to "abcdefghijklmn opqrstuvwxyz123 45"

    Granted, having alias names this long may seem a little goofy, but I
    am working on an object Persistence Layer that has the capability of
    sometimes generating long aliases behind the scenes.

    Does anyone know if this is a known limitation to PostgreSQL ? (I
    couldn't find any documentation which specifically addresses this
    issue) Is there a way to make PostreSQL support longer alias names?
    Are there any plans to address this in future version of PostgreSQL?
    Or... should I just "suck it up" and fix my code? ;-)

    I am using PostgreSQL version 7.2.3 on a RedHat 8 platform.

    Any insights or comments would be appreciated.

    Thanks,

    --Bill K.

    ----
    Bill Kratzer
    Senior Software Developer
    CommNav, Inc.

  • rstp

    #2
    Re: PostgreSQL Alias Name Length

    As of version 7.3, the maximum identifier length has been increased to
    63 characters. You should probably upgrade anyway, as there are quite a
    few improvements in 7.3 (7.3.3 is the latest stable version).
    HTH
    Ron


    Bill Kratzer wrote:[color=blue]
    > Hi...
    >
    > I am currently working on a Java-based product that is backed by
    > PostgreSQL (among other databases).
    >
    > I have noticed that PostgreSQL appears to truncate column alias names
    > after 31 characters. I have replicated this through JDBC (in Java),
    > PEAR (in PHP), and on the command-line interface (psql).
    >
    > For example (this is from the psql command-line tool):
    >
    > SELECT rss_headline_id as abcdefghijklmno pqrstuvwxyz1234 56, title, url
    > FROM news_rss_headli nes headlines WHERE rss_headline_id = 22833;
    > NOTICE: identifier "abcdefghijklmn opqrstuvwxyz123 456" will be
    > truncated to "abcdefghijklmn opqrstuvwxyz123 45"
    >
    > Granted, having alias names this long may seem a little goofy, but I
    > am working on an object Persistence Layer that has the capability of
    > sometimes generating long aliases behind the scenes.
    >
    > Does anyone know if this is a known limitation to PostgreSQL ? (I
    > couldn't find any documentation which specifically addresses this
    > issue) Is there a way to make PostreSQL support longer alias names?
    > Are there any plans to address this in future version of PostgreSQL?
    > Or... should I just "suck it up" and fix my code? ;-)
    >
    > I am using PostgreSQL version 7.2.3 on a RedHat 8 platform.
    >
    > Any insights or comments would be appreciated.
    >
    > Thanks,
    >
    > --Bill K.
    >
    > ----
    > Bill Kratzer
    > Senior Software Developer
    > CommNav, Inc.
    > http://www.commnav.com[/color]

    Comment

    Working...