Sender: owner-postgres95@postgres.Berkeley.EDU
X-Return-Path: andrew_yu
Received: from stud1.tuwien.ac.at (stud1.tuwien.ac.at [128.130.35.37]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id SAA23406 for <postgres95@postgres.berkeley.edu>; Fri, 10 Nov 1995 18:14:54 -0800
Received: by stud1.tuwien.ac.at (AIX 3.2/UCB 5.64/4.03)
          id AA17128; Sat, 11 Nov 1995 03:14:52 +0100
Date: Sat, 11 Nov 1995 03:14:52 +0100
From: e8903122@student.tuwien.ac.at (Richard Kail)
Message-Id: <9511110214.AA17128@stud1.tuwien.ac.at>
To: postgres95@postgres.Berkeley.EDU
Subject: Postgres 95 PL 14 Bug Report
Resent-To: postgres95-redist
Resent-Date: Fri, 10 Nov 95 18:14:56 -0800
Resent-From: pglite
Resent-XMts: smtp

To report a bug, please complete the following form and send it by
email to postgres95@postgres.berkeley.edu

============================================================================
                        POSTGRES95 BUG REPORT TEMPLATE
============================================================================


Your name		:	Richard Kail
Your email address	:	e8903122@stud1.tuwien.ac.at


System Configuration
---------------------
  Architecture (example: DEC Alpha AXP)  	:  Intel/PC

  Operating System (example: OSF/1 3.2)  	:  Linux 1.2.5

  Postgres95 version (example: Postgres95-1.0)  :  Postgres95-1.0 PL 14

  Compiler used (example:  gcc 2.6.3)		:  gcc 2.5.8 & 2.6.3


Please enter a FULL description of your problem:
------------------------------------------------
This is a problem with the \d command of psql.
If you are using the \d <relname> command of psql, you get a list of attributes
which isn't ordered as expected to use in a insert into ... command.


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible: 
----------------------------------------------------------------------

create table mytest (b int, a text);
\d mytest
[Output: first row: a......, second row: b....]
insert into mytest values ('This is my text for a', 39);
[Output: Error-Message]


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
In src/bin/psql/psql.c around line 275 there are statments building a 
sql-statement like this one:

DECLARE myportal CURSOR FOR
SELECT a.attname, t.typname, a.attlen
  FROM pg_class c, pg_attribute a, pg_type t 
    WHERE c.relname = 'mytest'
    and a.attnum > 0
    and a.attrelid = c.oid
    and a.atttypid = t.oid
  ORDER BY attname

I think, the 'ORDER BY attname' is the problem. I can't figure out, what will
be approbiate for this, perhaps there will be someone who is familiar with the
internal structures to fix this in some minutes.





===============================================================================
  To unsubscribe from the Postgres95 mailing list, send mail with the subject
  line "DEL" to "postgres95-request@postgres.Berkeley.EDU". 
============  URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres95/  ===========
