Lists: | pgsql-admin |
---|
From: | Igor Radtchenko <inta(at)komi(dot)parma(dot)ru> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Build from file syntax troublem. |
Date: | 2005-03-05 22:45:01 |
Message-ID: | 05030601450100.01195@inta |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
Hello, All!
I have to fiil datebase from file contains strings alike such:
CREATE SEQUENCE public.blacklist_id_seq INCREMENT 1 MINVALUE 1
MAXVALUE2147483647 CACHE 1;
and
CREATE FUNCTION public.from_days(int4) RETURNS timestamp AS '
select ''0000-01-02''::timestamp + ($1 || '' days'')::interval as result
' LANGUAGE 'sql' VOLATILE;
The parser abuse that
'parse error at or near '"." ',
'parse error at or near "public'" ',
'parse error at or near "#'" '.
PostgeSQL version is 7.2.3.
I've nowhere found isuch syntax in the net (I mean with dot -
'public.funcname(...)').
There is plpgsql only in the database;
When I try
./createlang -dbname=mydb sql
it says "unsupported language".
But SELECT * FROM pg_language
show that it's present.
Where I'm wrong?
Successes & good luck for all,
Igor
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Igor Radtchenko <inta(at)komi(dot)parma(dot)ru> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Build from file syntax troublem. |
Date: | 2005-03-05 23:38:26 |
Message-ID: | 27861.1110065906@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
Igor Radtchenko <inta(at)komi(dot)parma(dot)ru> writes:
> CREATE FUNCTION public.from_days(int4) RETURNS timestamp AS '
> select ''0000-01-02''::timestamp + ($1 || '' days'')::interval as result
> ' LANGUAGE 'sql' VOLATILE;
> The parser abuse that
> 'parse error at or near '"." ',
> 'parse error at or near "public'" ',
> 'parse error at or near "#'" '.
> PostgeSQL version is 7.2.3.
You need 7.3 or later to deal with schema-aware commands.
regards, tom lane
From: | Radtchenko Igor <inta(at)komi(dot)parma(dot)ru> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Build from file syntax troublem (part II). |
Date: | 2005-03-07 10:21:47 |
Message-ID: | 936719781.20050307132147@komi.parma.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
Hello Tom,
Thank you very much for such fast reply.
But now, after I've installed 8.0.1, it says things as examples in
little attach.
<------
Where I have to dig?.. :(
Sunday, March 06, 2005, 2:38:26 AM, you wrote:
TL> Igor Radtchenko <inta(at)komi(dot)parma(dot)ru> writes:
>> CREATE FUNCTION public.from_days(int4) RETURNS timestamp AS '
>> select ''0000-01-02''::timestamp + ($1 || '' days'')::interval as result
>> ' LANGUAGE 'sql' VOLATILE;
>> The parser abuse that
>> 'parse error at or near '"." ',
>> 'parse error at or near "public'" ',
>> 'parse error at or near "#'" '.
>> PostgeSQL version is 7.2.3.
TL> You need 7.3 or later to deal with schema-aware commands.
TL> regards, tom lane
--
Best regards,
Radtchenko mailto:inta(at)komi(dot)parma(dot)ru
Attachment | Content-Type | Size |
---|---|---|
nibs.errs | application/octet-stream | 3.4 KB |
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Radtchenko Igor <inta(at)komi(dot)parma(dot)ru> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Build from file syntax troublem (part II). |
Date: | 2005-03-07 14:35:44 |
Message-ID: | 22994.1110206144@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
Radtchenko Igor <inta(at)komi(dot)parma(dot)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