Search Postgresql Archives

Re: Error or bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincenzo Romano <vincenzo.romano@xxxxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux