Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
От | David Adams |
---|---|
Тема | Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC |
Дата | |
Msg-id | CAPXPcQv85n4ek+9YeyaDQLhsaHJ0b0RhcokHd6GZXMJ0XNgJLQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC ("David G. Johnston" <david.g.johnston@gmail.com>) |
Ответы |
Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
|
Список | pgsql-bugs |
Thanks for the answer, a user error would be best case for me as then I can fix it.
I was hoping that cutting down my real routines to a simple example wouldn't introduce errors, maybe it did. The form I'm following is shown the docs like so:
```
BEGIN ATOMIC
statement;
statement;
...
statement;
END
```
My code is
```
BEGIN ATOMIC
return 'atomic';
END;
```
Apart from the final semi-colon, it's exactly the same form, as far as I can see. Taking the semi-colon out doesn't change anything.
In this toy example, `BEGIN ATOMIC` serves no purpose. In my real code, `BEGIN ATOMIC` is *very* helpful, as it puts table and column refernces into the autoamtic dependency tree.
Not sure what I'm missing here, hope it really is something simple.
I was hoping that cutting down my real routines to a simple example wouldn't introduce errors, maybe it did. The form I'm following is shown the docs like so:
```
BEGIN ATOMIC
statement;
statement;
...
statement;
END
```
My code is
```
BEGIN ATOMIC
return 'atomic';
END;
```
Apart from the final semi-colon, it's exactly the same form, as far as I can see. Taking the semi-colon out doesn't change anything.
In this toy example, `BEGIN ATOMIC` serves no purpose. In my real code, `BEGIN ATOMIC` is *very* helpful, as it puts table and column refernces into the autoamtic dependency tree.
Not sure what I'm missing here, hope it really is something simple.
On Mon, Mar 13, 2023 at 3:47 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Sunday, March 12, 2023, David Adams <dpadams@gmail.com> wrote:
DROP FUNCTION IF EXISTS tools.tell_me_how_atomic();
CREATE OR REPLACE FUNCTION tools.tell_me_how_atomic()
RETURNS text
LANGUAGE SQL
BEGIN ATOMIC
return 'atomic';
END;Not a bug, user-error.There are two valid function body forms defined under “sql_body”. Yours is neither of those. Rewrite your body using one of those forms. Removing being/end would make sense for this example.David J.
В списке pgsql-bugs по дате отправления: