Thread

  1. General Bug Report: pg_attribute a.attlen does not return correct values

    Unprivileged user <nobody> — 1999-01-11T04:49:22Z

    ============================================================================
                            POSTGRESQL BUG REPORT TEMPLATE
    ============================================================================
    
    
    Your name		: Dinh Le
    Your email address	: dinh@flic.net
    
    Category		: runtime: back-end
    Severity		: non-critical
    
    Summary: pg_attribute a.attlen does not return correct values
    
    System Configuration
    --------------------
      Operating System   : Linux 2.0.36
    
      PostgreSQL version : 6.4.2
    
      Compiler used      : gcc 2.7.2
    
    Hardware:
    ---------
    
    
    Versions of other tools:
    ------------------------
    gnu make
    
    --------------------------------------------------------------------------
    
    Problem Description:
    --------------------
    Execute the following SQL command
    
      SELECT a.attnum, a.attname, t.typname, a.attlen,
           a.atttypmod, a.attnotnull, a.atthasdef
      FROM pg_class c, pg_attribute a, pg_type t
      WHERE c.relname = 'a table'
          and a.attnum > 0
          and a.attrelid = c.oid
          and a.atttypid = t.oid
      ORDER BY attnum;
    
    used to return the correct value for a.attlen.  The
    current Postgres 6.4.2 for Linux always return -1.
    
    --------------------------------------------------------------------------
    
    Test Case:
    ----------
    Run psql and execute the SQL command
    
      SELECT a.attnum, a.attname, t.typname, a.attlen,
           a.atttypmod, a.attnotnull, a.atthasdef
      FROM pg_class c, pg_attribute a, pg_type t
      WHERE c.relname = 'table'
          and a.attnum > 0
          and a.attrelid = c.oid
          and a.atttypid = t.oid
      ORDER BY attnum;
    
    where 'table' is an existing table.
    
    --------------------------------------------------------------------------
    
    Solution:
    ---------
    
    
    --------------------------------------------------------------------------