Re: Error or bug? - Mailing list pgsql-general

From Tom Lane
Subject Re: Error or bug?
Date
Msg-id 7415.1182811079@sss.pgh.pa.us
Whole thread Raw
In response to Error or bug?  (Vincenzo Romano <vincenzo.romano@notorand.it>)
List pgsql-general
Vincenzo Romano <vincenzo.romano@notorand.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

pgsql-general by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: CHECK
Next
From: Michael Glaesemann
Date:
Subject: Re: Throwing exceptions