Subject: create: syntax error

From: [email-masked] (J.Plewe)
Date: Wed, 29 Jun 94 17:36:38 +0200

Sigh,

I'm quite new to Postgres and this may be the reason for having
so much problems. Sorry.

Now I failed with a create-statement and don't know why:

/* Definition der Klasse mvd_visfunc */

destroy mvd_visfunc
\g
create mvd_visfunc (
	classid = int4,
	function = text, 
	classname = text, 
	attribute = text
	 )
\g

Query sent to backend is "create mvd_visfunc ( 	classid = int4, 	function = text,  	classname = text,  	attribute = text 	 ) "
WARN:Jun 29 15:25:33:parser: syntax error at or near "function"

When I replace 'function' against 'funcname' it works. Why??

- Joerg

*********************************************************************
Dipl. Phys. Joerg Plewe               [email-masked]
MPI fuer molekulare Physiologie
Rheinlanddamm 201
44139 Dortmund
Germany                               +49 (0)231 1206 384
*********************************************************************

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================

---

From: avi pfeffer <[email-masked]>
Date: Wed, 29 Jun 1994 10:33:10 -0700

> create mvd_visfunc (
> 	classid = int4,
> 	function = text, 
> 	classname = text, 
> 	attribute = text
> 	 )
> \g
> 
> 
> Query sent to backend is "create mvd_visfunc ( 	classid = int4, 	functio
> n = text,  	classname = text,  	attribute = text 	 ) "

"function" is a reserved word in POSTQUEL so the parser chokes when
you try to use it as an attribute name.

Avi