hasura / learn-graphql

Real world GraphQL tutorials for frontend developers with deadlines!
https://hasura.io/learn/
MIT License
1.18k stars 647 forks source link

fix(postgresql): correct ALTER TABLE command #1017

Closed kakakakakku closed 6 months ago

kakakakakku commented 6 months ago

Description

Thank you for providing an easily understandable PostgreSQL tutorial :)

While following the tutorial, I found a minor mistake in the PostgreSQL Tutorial "ALTER Statements". The instructions involves renaming the "users" table to "users_renamed". Then, the following error occurs:

postgres=# ALTER TABLE users RENAME COLUMN created_at TO created;
ERROR:  relation "users" does not exist

I fixed it like below.

postgres=# ALTER TABLE users_renamed RENAME COLUMN created_at TO created;
ALTER TABLE

Could you review please? Thanks.

Related Issues

N/A

Solution and Design

N/A

Steps to test and verify

N/A

Limitations, known bugs & workarounds

N/A

praveenweb commented 6 months ago

@kakakakakku - Thanks for the PR. Although the ALTER statement was given as a reference, if you actually ended up following it in order as a tutorial, it does fail as you mentioned.

Merging this.