Using row_to_json with %ROWTYPE ? - Mailing list pgsql-general

From Tim Smith
Subject Using row_to_json with %ROWTYPE ?
Date
Msg-id CA+HuS5EbRgf49KBhBjF5hgT7-GEn7S-GeAkLks7xkzMqCCOfzA@mail.gmail.com
Whole thread Raw
Responses Re: Using row_to_json with %ROWTYPE ?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Using row_to_json with %ROWTYPE ?  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-general
Hi,

I have a function that broadly looks like this :

create function doStuff() returns json as $$
DECLARE
v_row my_view%ROWTYPE;
BEGIN
select * into strict v_row from my_view where foo=bar;
select row_to_json(v_row) from v_row;
END;
$$ LANGUAGE plpgsql;


However this does not seem to work ?   What am I doing wrong ?

Thanks

Tim


pgsql-general by date:

Previous
From: Rémi Cura
Date:
Subject: Re: How do I bump a row to the front of sort efficiently
Next
From: Adrian Klaver
Date:
Subject: Re: Using row_to_json with %ROWTYPE ?