Samik Raychaudhuri <samik@cae.wisc.edu> writes:
> Hi,
> Thanks a lot for the pointer. But it seems I can't run these commands
> through psql. Specifically, I am trying to run the following file
> through psql, and getting the errors as below. I used to do similar
> stuff in Sybase.
You need to define a PL/pgSQL function that contains your code.
'psql' takes straight SQL code, which does not support IF/THEN/ELSE.
-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863