Re: Build from file syntax troublem (part II). - Mailing list pgsql-admin

From Tom Lane
Subject Re: Build from file syntax troublem (part II).
Date
Msg-id 22994.1110206144@sss.pgh.pa.us
Whole thread Raw
In response to Re: Build from file syntax troublem (part II).  (Radtchenko Igor <inta@komi.parma.ru>)
List pgsql-admin
Radtchenko Igor <inta@komi.parma.ru> writes:
> But now, after I've installed 8.0.1, it says things as examples in
> little attach.

> freenibs=# CREATE FUNCTION public.if(int4, int4, int4) RETURNS int4 AS '
> freenibs'# DECLARE
> freenibs'#  expr1 ALIAS FOR $1;
> freenibs'#  expr2 ALIAS FOR $2;
> ...
> freenibs'# END;
> freenibs'# '  LANGUAGE 'sql' VOLATILE;
> ERROR:  syntax error at or near "ALIAS" at character 78
> LINE 3:  expr1 ALIAS FOR $1;

That's a plpgsql function, not an sql function.  Your other examples
look like they were taken from some other database that has different
extensions to the SQL spec than we do: there is no "varchar binary"
in Postgres, and we don't allow you to add random commas at the ends
of column lists.  PG isn't going to like '0000-00-00' for a date,
either.

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] Postgres schema comparison.
Next
From: Stef
Date:
Subject: Re: Postgres schema comparison.