pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: Gifford Hesketh <gifford.hesketh@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: "copy from" in "create function"
Date: Mon, 25 Oct 2004 13:19:02 -0400
Message-ID: <417D3586.10600@Yahoo.com> (raw)
In-Reply-To: <4f6940a604102015034e5560bb@mail.gmail.com>
References: <4f6940a604102015034e5560bb@mail.gmail.com>

On 10/20/2004 6:03 PM, Gifford Hesketh wrote:

> Am I forgetting some limitation ?  I get "ERROR:  syntax error at or
> near "$1" at character 22" with this:
> 
> CREATE FUNCTION public.fn_b_import( text ) RETURNS void AS 
> '
> COPY b_import FROM $1 ;
> '
> LANGUAGE 'sql' STABLE;

Utility statements don't accept parameters for arguments. Use the 
EXECUTE syntax of PL/pgSQL for this.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



view thread (2+ messages)

Message-ID: <417D3586.10600@Yahoo.com>
Permalink:  ../417D3586.10600@Yahoo.com/
Also on:    postgresql.org/message-id/417D3586.10600@Yahoo.com

 · 

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-sql@postgresql.org
  Cc: JanWieck@Yahoo.com, gifford.hesketh@gmail.com
  Subject: Re: "copy from" in "create function"
  In-Reply-To: <417D3586.10600@Yahoo.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