Can't work out what is wrong with this code

From: Simon Connah <simon(dot)n(dot)connah(at)protonmail(dot)com>
To: "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Can't work out what is wrong with this code
Date: 2021-04-09 07:47:06
Message-ID: 5RtDKcDlGNlakqqw7RBiZueSkBmFuloOmz5p5L0twUfpsq1RHAYyLkhQTCdeuf-WiXRQPmHyiO4_jM-vlQUgQi-pZPrrx3DQeOZinLmd6s4=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I'm trying to return a row from a table and I'm having a tough time working out how to do it.

Here is my code:

https://gist.github.com/simonconnah/86f4a8ecb41f9ea3a4c759e5eba5c850

When I try and call the get_blog function in JavaScript I just get undefined which is not very helpful. Can someone point me in the right direction please?

Simon.

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Tucknott (TuSol) 2021-04-13 12:40:51 Advice on foreign key and cascading delete design - postgresql 12.6
Previous Message Simon Connah 2021-04-07 11:54:31 Re: Return a table from a function