From: John DeSoi <desoi@pgedit.com>
To: 'pgsql-sql@postgresql.org' SQL <pgsql-sql@postgresql.org>
Subject: info is a reserved word?
Date: Thu, 12 Jan 2006 20:14:42 -0500
Message-ID: <304B868D-CE4E-4E43-8B85-4CA238BB0F94@pgedit.com> (raw)
I have two identical functions below, the only difference is I
declared my variable name to be 'info' instead of 'stuff'. I could
not find anywhere in the docs that 'info' has any special meaning.
Did I miss it?
create type my_info as (
a text,
b text
);
-- this works
create or replace function my_stuff ()
returns my_info as $$
declare
stuff my_info;
begin
stuff.a := 'hi';
stuff.b := 'there';
return stuff;
end;
$$ language plpgsql;
create or replace function my_stuff ()
returns my_info as $$
declare
info my_info;
begin
info.a := 'hi';
info.b := 'there';
return info;
end;
$$ language plpgsql;
Evaluating this definition gives:
psql:16: ERROR: syntax error at or near "info" at character 71
psql:16: LINE 4: info my_info;
psql:16: ^
pg 8.1.1, OS X 10.4.3
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: desoi@pgedit.com
Subject: Re: info is a reserved word?
In-Reply-To: <304B868D-CE4E-4E43-8B85-4CA238BB0F94@pgedit.com>
References: <304B868D-CE4E-4E43-8B85-4CA238BB0F94@pgedit.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox