Re: Error or bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error or bug?
Date: 2007-06-25 22:37:59
Message-ID: 7415.1182811079@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it> writes:
> Under PGSQL v8.2.4, in a PL/PgSQL function whenver I try to run this
> statement:
> INSERT INTO table1 SELECT var1.*;
> I get his message:
> ERROR: record type has not been registered

Works for me:

$ psql ...
Welcome to psql 8.2.4, the PostgreSQL interactive terminal.
...
regression=# create table table1(f1 int, f2 text);
CREATE TABLE
regression=# create or replace function foo() returns void as $$
declare var1 table1;
begin
select * into var1 from table1;
insert into table1 select var1.*;
end$$ language plpgsql;
CREATE FUNCTION
regression=# insert into table1 values(1,'one');
INSERT 0 1
regression=# select foo();
foo
-----

(1 row)

regression=# select * from table1;
f1 | f2
----+-----
1 | one
1 | one
(2 rows)

If that's not what you did, then let's see exactly what you did do.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2007-06-26 00:01:18 Re: Throwing exceptions
Previous Message Richard Broersma Jr 2007-06-25 22:06:03 Re: CHECK