I am new in PostgreSQL, I have a stored procedure which is written in T-SQL and I want to convert this to PostgreSQL. I have done so far but I am stuck at place I searched so many places but not found anything in internet.
Below is the T-SQL stored procedure which I need adapted to PGSQL
If <someCondi>
BEGIN
...
END
ELSE
BEGIN
GENERATE:
BEGIN try
IF <someCondi>
BEGIN
...
END
ELSE
BEGIN
...
END
END try
BEGIN catch
IF <someCondi>
BEGIN
...
END
if @LoopCount<=2
begin
goto GENERATE
end
END catch
END
I have convert most of the stored procedure part but I need alternate of else part. Don't know how to convert try catch in pgsql and also what is alternative for GOTO. Please help