Subject: addattr problem

From: [email-masked] (Song Koh)
Date: Tue, 9 Jul 91 11:20:43 -0700

There seems to be a problem in the addattr function...  Here is a
summary of problem:

- create table t1
- create table t2 which inherits from t1
- add record to t1 and t2  and retrieve to check
- try to addattr using the "*" 

	addattr( a5=int2) to t1 *\g

	Query sent to backend is "addattr( a5=int2) to t1 *"
	WARN:Jul  8 13:04:59:parser: syntax error at or near "*"

- addattr without "*"
- check tables. 
- try a retrieve with a "*"

	There is a duplicate record in t1.

- leave monitor
- reenter monitor
- check tables
- try a retrieve with a "*"

	retrieve (t.all) from t in t1 *\g

	Query sent to backend is "retrieve (t.all) from t in t1 *"
	Error: No response from the backend, exiting...

	unix prompt here....

A detailed transcript is below.
------------------------------------------------------------------------
Song Koh			Harris Semiconductor
[email-masked]		MS 62-024
Voice: (407)-724-7085		P. O Box 883
Fax:   (407)-729-4960		Melbourne, FL 32902-0883
------------------------------------------------------------------------

swk@seymour> monitor swk
Welcome to the C POSTGRES terminal monitor

Go 
* create t1 ( a1=int2, a2=int2)\g

Query sent to backend is "create t1 ( a1=int2, a2=int2)"
CREATE
Go 
* create t2 (a3=int2,a4=int2) inherits (t1)\g

Query sent to backend is "create t2 (a3=int2,a4=int2) inherits (t1)"
CREATE
Go 

* /* append some data */
append t1 (a1 = 1,a2=2)\g

Query sent to backend is "append t1 (a1 = 1,a2=2)"
APPEND
Go 
* retrieve (t1.all)\g

Query sent to backend is "retrieve (t1.all)"
-----------------------------
| a1          | a2          |
-----------------------------
| 1           | 2           |
-----------------------------

Go 
* append t2 ( a1=11,a2=12,a3=13,a4=14)\g

Query sent to backend is "append t2 ( a1=11,a2=12,a3=13,a4=14)"
APPEND
Go 
* retrieve (t2.all)\g

Query sent to backend is "retrieve (t2.all)"
---------------------------------------------------------
| a3          | a4          | a2          | a1          |
---------------------------------------------------------
| 13          | 14          | 12          | 11          |
---------------------------------------------------------

Go 
* /* retrieve data with the * */

retrieve ( t.all) from t in t1 *\g

Query sent to backend is "retrieve ( t.all) from t in t1 *"
-----------------------------
| a1          | a2          |
-----------------------------
| 1           | 2           |
-----------------------------
| 11          | 12          |
-----------------------------

Go 
* /* try to addattr using */

addattr( a5=int2) to t1 *\g

Query sent to backend is "addattr( a5=int2) to t1 *"
WARN:Jul  8 13:04:59:parser: syntax error at or near "*"

Go 
* /* can't doit....  try adding without * */
addattr(a5=int2) to t1\g

Query sent to backend is "addattr(a5=int2) to t1"
ADD
Go 
* retrieve (t1.all)\g

Query sent to backend is "retrieve (t1.all)"
-------------------------------------------
| a1          | a2          | a5          |
-------------------------------------------
| 1           | 2           | (null)      |
-------------------------------------------

Go 
* /* that works ok */

retrieve (t2.all)\g

Query sent to backend is "retrieve (t2.all)"
---------------------------------------------------------
| a3          | a4          | a2          | a1          |
---------------------------------------------------------
| 13          | 14          | 12          | 11          |
---------------------------------------------------------

Go 
* retrieve (t1.all) from t in t1 *\g

Query sent to backend is "retrieve (t1.all) from t in t1 *"
-------------------------------------------
| a1          | a2          | a5          |
-------------------------------------------
| 1           | 2           | (null)      |
-------------------------------------------
| 1           | 2           | (null)      |
-------------------------------------------

Go 
* /* now it is really confused... I get two copies of the same record?*/
  /* now quit, and then come back in...*/
 \q
I live to serve you.
swk@seymour> monitor swk
Welcome to the C POSTGRES terminal monitor

Go 
* retrieve (t1.all)\g

Query sent to backend is "retrieve (t1.all)"
-------------------------------------------
| a1          | a2          | a5          |
-------------------------------------------
| 1           | 2           | (null)      |
-------------------------------------------

Go 
*  /* this will make it crash */
retrieve (t.all) from t in t1 *\g

Query sent to backend is "retrieve (t.all) from t in t1 *"
Error: No response from the backend, exiting...

swk@seymour> !!
monitor swk
Welcome to the C POSTGRES terminal monitor

Go 
* retrieve (t2.all)\g

Query sent to backend is "retrieve (t2.all)"
---------------------------------------------------------
| a3          | a4          | a2          | a1          |
---------------------------------------------------------
| 13          | 14          | 12          | 11          |
---------------------------------------------------------

Go 
* retrieve (t1.all)\g

Query sent to backend is "retrieve (t1.all)"
-------------------------------------------
| a1          | a2          | a5          |
-------------------------------------------
| 1           | 2           | (null)      |
-------------------------------------------

Go 
* retrieve (t.all) from t in t1\g

Query sent to backend is "retrieve (t.all) from t in t1"
-------------------------------------------
| a1          | a2          | a5          |
-------------------------------------------
| 1           | 2           | (null)      |
-------------------------------------------

Go 
* /* tables seem to be ok */
\q
swk@seymour>