Tom Lane a écrit :
Denis BUCHER dbuche...@hsolutions.ch writes:
To do this it will be a little complicated because of table
dependencies... And it could bug again at the next DROP COLUMN... Is
there a way to change my function (RETURN SETOF part) to specify the
column names/types ?
No, not
Hello,
I have a strange problem, because it worked in a fonction for a table,
and now I created the same (?) function for another table and it doesn't
work...
The function is accepted but at runtime I get :
ERREUR: wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function
Denis BUCHER wrote:
ERREUR: wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function hds_bw_find_sn_live line 26 at return next
Does someone maybe knows what it could be ?
This is (a part of) my function :
CREATE OR REPLACE FUNCTION rma.find_sn_live (varchar(30))
Richard Huxton a écrit :
ERREUR: wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function hds_bw_find_sn_live line 26 at return next
Does someone maybe knows what it could be ?
This is (a part of) my function :
CREATE OR REPLACE FUNCTION rma.find_sn_live (varchar(30))
Denis BUCHER wrote:
Richard Huxton a écrit :
ERREUR: wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function hds_bw_find_sn_live line 26 at return next
Does someone maybe knows what it could be ?
This is (a part of) my function :
CREATE OR REPLACE FUNCTION rma.find_sn_live
Hello Richard,
Richard Huxton a écrit :
ERREUR: wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function hds_bw_find_sn_live line 26 at return next
Does someone maybe knows what it could be ?
This is (a part of) my function :
CREATE OR REPLACE FUNCTION rma.find_sn_live
Denis BUCHER wrote:
I saw somwhere it could be the order of the fields ?
Not if you are doing SELECT * FROM.
Create an empty test database and a short script to create the table and
function, insert a couple of rows then call the function. If you wrap
the whole thing in BEGIN ... ROLLBACK we
Hello Richard,
Richard Huxton a écrit :
I saw somwhere it could be the order of the fields ?
Not if you are doing SELECT * FROM.
Create an empty test database and a short script to create the table and
function, insert a couple of rows then call the function. If you wrap
the whole thing
Denis BUCHER wrote:
Richard Huxton a écrit :
The other thing you could try is printing out row before returning it:
RAISE NOTICE 'row = %', row;
RETURN NEXT ROW;
It might be you've not got what you were expecting.
Thanks a lot, good idea...
But it looks good :
Hmm...
SELECT *
Denis BUCHER dbuche...@hsolutions.ch writes:
I have a strange problem, because it worked in a fonction for a table,
and now I created the same (?) function for another table and it doesn't
work...
The function is accepted but at runtime I get :
ERREUR: wrong record type supplied in RETURN
Richard Huxton a écrit :
The other thing you could try is printing out row before returning it:
RAISE NOTICE 'row = %', row;
RETURN NEXT ROW;
It might be you've not got what you were expecting.
Thanks a lot, good idea...
But it looks good :
Hmm...
SELECT * FROM rma.test
Hello Tom,
Tom Lane a écrit :
Denis BUCHER dbuche...@hsolutions.ch writes:
I have a strange problem, because it worked in a fonction for a table,
and now I created the same (?) function for another table and it doesn't
work...
The function is accepted but at runtime I get :
ERREUR:
Denis BUCHER wrote:
Bienvenue dans psql 8.1.17, l'interface interactive de PostgreSQL.
OK - I'm not aware of any problems in that version. You're only one
revision from the latest 8.1.x series.
OK I prepared what you asked and I tested it myself before sending.
And I think I've found the
Tom Lane wrote:
Denis BUCHER dbuche...@hsolutions.ch writes:
Does that table have any dropped columns? If you don't remember
whether you ever dropped any columns, a quick look into pg_attribute
will tell you:
select attname from pg_attribute where attrelid =
Hi Tom,
Another question :
Tom Lane a écrit :
Denis BUCHER dbuche...@hsolutions.ch writes:
I have a strange problem, because it worked in a fonction for a table,
and now I created the same (?) function for another table and it doesn't
work...
The function is accepted but at runtime I get
Denis BUCHER dbuche...@hsolutions.ch writes:
To do this it will be a little complicated because of table
dependencies... And it could bug again at the next DROP COLUMN... Is
there a way to change my function (RETURN SETOF part) to specify the
column names/types ?
No, not really. You could
16 matches
Mail list logo