Skip site navigation (1) Skip section navigation (2)

Re: Create table in functions

From: Jie Liang <jliang(at)ipinc(dot)com>
To: Andreas Tille <tillea(at)rki(dot)de>
Cc: PostgreSQL SQL <pgsql-sql(at)hub(dot)org>
Subject: Re: Create table in functions
Date: 2000-08-23 16:46:59
Message-ID: 39A40003.8F50A962@ipinc.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hi, there,

I don't think that you can use DDL in PL/pgSQL, normally say , you can
only use DML in PL/pgSQL.
i.e. you can use select into,update,delete,insert ... , but you cannot use
create, alter, grant ...


Andreas Tille wrote:

> Hello,
>
> I striped down my function up to a strange thing:
>
> web=# create function pHelpTable( )
> web-#   returns int
> web-#   As '
> web'#     Begin
> web'#       Create Table Temp_NumTable  ( Num int ) ;
> web'#
> web'#       return 17 ;
> web'#     End; '
> web-#   language 'plpgsql' ;
> CREATE
> web=#
> web=# select pHelpTable( );
> ERROR:  copyObject: don't know how to copy 611
> web=#
>
> What does this mean?  The ERROR is caused by the Create Table statement
> (when I removed it from my complex function it worked well).
> So why doesn't this work and what copy function fails here??
>
> Kind regards
>
>           Andreas.

--
Jie LIANG

Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang(at)ipinc(dot)com
www.ipinc.com




In response to

pgsql-sql by date

Next:From: Jan WieckDate: 2000-08-23 16:53:06
Subject: Re: Using SETOF in plpgsql function
Previous:From: Franz J FortunyDate: 2000-08-23 16:42:29
Subject: Re: Speed or configuration

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group