Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] pgaccess 0.86

From: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
To: interfaces postgres <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] pgaccess 0.86
Date: 1998-05-25 14:56:27
Message-ID: Pine.LNX.3.96.980525144138.1258A-100000@proxy.bazzanese.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Mon, 25 May 1998, Jose' Soares Da Silva wrote:

> Hi,
> I'm playing with pgaccess 0.86, it's a very interesting tool, congratulations 
> to Teo for the excellent job.
> I would report a bug on table information:
> 
> pgaccess displays the wrong size for types varchar (see your phonebook
> example):
> 
> table name	phonebook
> owner		marco
> field information:
> ---------------------------------------
> field name	field type	size
> ---------------------------------------
> name		varchar		-5           <-- (32)
> phone_nr	varchar		-5           <-- (16)
> city		varcahr		-5           <-- (32)
> company	bool		1
> continent	char16		16
> ---------------------------------------
The size lenght is stored in field "attlen" for types other than VARCHAR
and BPCHAR. In this case "attlen" = -1 and size lenght+4 is stored in
field "atttypmod".

Here a bug fix:
-------------------------------------------------------------------------------
2423 proc {show_table_information} {tblname} {
2423 global dbc tiw activetab indexlist
2423 set tiw(tablename) $tblname
2423 if {$tiw(tablename)==""} return;
2423 Window show .tiw
2423 .tiw.lb delete 0 end                          vvvvvvvvvvvvvvvvvvvvvvvvvvv
2423 .tiw.ilb delete 0 end                         > field atttypmod         >
2423 set tiw(isunique) {}                          > contains lenght         >
2423 set tiw(isclustered) {}                       > for VARCHAR and BPCHAR  >
2423 set tiw(indexfields) {}                               vvvvvvvvv
2423 pg_select $dbc "select attnum,attname,typname,attlen, atttypmod, usename,pg_class.oid from pg_class,pg_user,pg_attribute,pg_type where (pg_class.relname='$tiw(tablename)') and (pg_class.oid=pg_attribute.attrelid) and (pg_class.relowner=pg_user.usesys
id) and (pg_attribute.atttypid=pg_type.oid) order by attnum" rec {
2423     set fsize $rec(attlen)
2423     set ftype $rec(typname)
2423     if {$fsize=="-1"} {                 <- if (attlen > 0) then
2423        set fsize $rec(atttypmod)        <-    LENGHT = attlen
2423        incr fsize -4                    <- else
2423        }                                <-    LENGHT = attypmod - 4
2423     if {$ftype=="text"} {
2423         set fsize ""
2423     }
-----------------------------------------------------------------------------
                                                       Jose'


In response to

  • pgaccess 0.86 at 1998-05-25 12:56:14 from Jose' Soares Da Silva

Responses

pgsql-interfaces by date

Next:From: Tim BosiniusDate: 1998-05-25 21:00:35
Subject: ODBC & Postgres problem
Previous:From: David HartwigDate: 1998-05-25 13:01:39
Subject: Re: [SQL] ODBC Sources

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group