X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8EE2C32A0CE for ; Tue, 19 Oct 2004 15:50:24 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19210-01 for ; Tue, 19 Oct 2004 14:50:17 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 5660832A44A for ; Tue, 19 Oct 2004 15:50:18 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i9JEoDJ7019551 for ; Tue, 19 Oct 2004 14:50:13 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i9JELMxg009396 for pgsql-docs@postgresql.org; Tue, 19 Oct 2004 14:21:22 GMT From: "Hicham G. Elmongui" X-Newsgroups: comp.databases.postgresql.docs Subject: code in docs gives me an error Date: Tue, 19 Oct 2004 09:21:26 -0500 Organization: Hub.Org Networking Services Lines: 20 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 To: pgsql-docs@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=PRIORITY_NO_NAME, UPPERCASE_25_50 X-Spam-Level: * X-Archive-Number: 200410/49 X-Sequence-Number: 2618 Hi 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 ' DECLARE in_t ALIAS FOR $1; BEGIN RETURN in_t.f1 || in_t.f3 || in_t.f5 || in_t.f7; END; ' LANGUAGE 'plpgsql'; Thanks, --Hicham