lib/arjdbc/postgresql/adapter.rb
# Returns the list of a table's column names, data types, and default values.
#
# If the table name is not prefixed with a schema, the database will
# take the first match from the schema search path.
#
# Query implementation notes:
#  - format_type includes the column size constraint, e.g. varchar(50)
#  - ::regclass is a function that gives the id for a table name
Returns the list of a table's column names, data types, and default values.
If the table name is not prefixed with a schema, the database will
take the first match from the schema search path.

Query implementation notes:
format_type includes the column size constraint, e.g. varchar(50)
::regclass is a function that gives the id for a table name
Returns the list of a table ' s column names data types and default values . If the table name is not prefixed with a schema the database will take the first match from the schema search path . Query implementation notes : format_type includes the column size constraint e . g . varchar ( 50 ) :: regclass is a function that gives the id for a table name
def column_definitions(table_name)
      rows = select_rows(<<-end_sql, 'SCHEMA')
        SELECT a.attname, format_type(a.atttypid, a.atttypmod),
               pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
               (SELECT c.collname FROM pg_collation c, pg_type t
                 WHERE c.oid = a.attcollation AND t.oid = a.atttypid
                  AND a.attcollation <> t.typcollation),
               col_description(a.attrelid, a.attnum) AS comment
          FROM pg_attribute a
          LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
         WHERE a.attrelid = '#{quote_table_name(table_name)}'::regclass
           AND a.attnum > 0 AND NOT a.attisdropped
         ORDER BY a.attnum
      end_sql
      rows.each do |row|
        row[3] = row[3] == 't' if row[3].is_a?(String)
      end
    end
def column_definitions ( table_name ) rows = select_rows ( <<-end_sql , 'SCHEMA' ) 
        SELECT a.attname, format_type(a.atttypid, a.atttypmod),
               pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
               (SELECT c.collname FROM pg_collation c, pg_type t
                 WHERE c.oid = a.attcollation AND t.oid = a.atttypid
                  AND a.attcollation <> t.typcollation),
               col_description(a.attrelid, a.attnum) AS comment
          FROM pg_attribute a
          LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
         WHERE a.attrelid = ' #{ quote_table_name ( table_name ) } '::regclass
           AND a.attnum > 0 AND NOT a.attisdropped
         ORDER BY a.attnum
       end_sql rows . each do | row | row [ 3 ] = row [ 3 ] == 't' if row [ 3 ] . is_a? ( String ) end end
Returns the list of a table's column names, data types, and default values.
Returns the list of a table ' s column names data types and default values .
# Force the notnull attribute to a boolean
table_name
<not_specific>