Support USING clause
Hi,
By using the ALTER TABLE, I found out there is an issue regarding the ALTER COLUMN. E.g.,
Unexpected kw_using token: "using". Instead, I was expecting to see one of the following:
- A "dot" token
- A "lparen" token
- A "kw_array" token
- A "lbracket" token
- A "semicolon" token
Would it be possible to add the USING clause? It would be useful for data migration when updating columns in a table.
For example:
CREATE TABLE example (
id serial PRIMARY KEY,
name TEXT NOT NULL,
price VARCHAR
);
INSERT INTO example(name,price) VALUES('ex','10');
Then we need the USING clause to migrate the existing data:
ALTER TABLE example ALTER COLUMN price TYPE INT USING price::integer
Hi !
I dont have much time these days, but I'm adding that to my todo list.
Thanks for the report :)
The using keyword is also unrecognized in delete statements, e.g.
delete from pending_password_reset p
using user_account u
where p.user_account_id = u.id
and u.email_address = '[email protected]';
The workaround would be something like this:
delete from pending_password_reset
where user_account_id in (
select id
from user_account
where email_address = '[email protected]'
);
I dont have much time these days, but I'm adding that to my todo list.
I know the feeling! You've done amazing work so far.
Looking forward to this feature :D