pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Hicham G. Elmongui <elmongui@cs.purdue.edu>
Cc: pgsql-docs@postgresql.org
Subject: Re: code in docs gives me an error
Date: Wed, 20 Oct 2004 16:52:50 +0100
Message-ID: <1098287570.24233.32.camel@linda> (raw)
In-Reply-To: <cl37t2$95f$1@news.hub.org>
References: <cl37t2$95f$1@news.hub.org>

On Tue, 2004-10-19 at 15:21, Hicham G. Elmongui wrote:
> I tried creating the function (from sec 19.3.1). But it gives me the
> following error: "ERROR:  type tablename does not exist".
> Any ideas of what i might be doing wrong?
> 
> CREATE FUNCTION use_many_fields(tablename) RETURNS TEXT AS '

You are passing a composite type for a row from the table called
"tablename"; such a table does not exist.  Use the name of a table that
actually exists (and has the fields named in the RETURN statement).

> DECLARE
>     in_t ALIAS FOR $1;
> BEGIN
>     RETURN in_t.f1 || in_t.f3 || in_t.f5 || in_t.f7;
> END;
> ' LANGUAGE 'plpgsql';

-- 
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "For the LORD God is a sun and shield; the LORD will 
      give grace and glory; no good thing will he withhold 
      from them that walk uprightly."        Psalms 84:11 




view thread (2+ messages)

Message-ID: <1098287570.24233.32.camel@linda>
Permalink:  ../1098287570.24233.32.camel@linda/
Also on:    postgresql.org/message-id/1098287570.24233.32.camel@linda

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: olly@lfix.co.uk, elmongui@cs.purdue.edu
  Subject: Re: code in docs gives me an error
  In-Reply-To: <1098287570.24233.32.camel@linda>

* 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