On 04/02/2016 06:07 PM, Seamus Abshere wrote:
hi,
I want to write a function that updates arbitrary columns and here's my
pseudocode:
CREATE OR REPLACE FUNCTION update_pet(id int, raw_data jsonb) RETURNS
VOID AS $$
DECLARE
data record;
BEGIN
SELECT jsonb_populate_record(null::pets,
hi,
I want to write a function that updates arbitrary columns and here's my
pseudocode:
CREATE OR REPLACE FUNCTION update_pet(id int, raw_data jsonb) RETURNS
VOID AS $$
DECLARE
data record;
BEGIN
SELECT jsonb_populate_record(null::pets, raw_data) INTO data;
UPDATE pets [... from data ...]