Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use table alias in WHERE clause when JOINing #140

Closed
wants to merge 2 commits into from
Closed

Use table alias in WHERE clause when JOINing #140

wants to merge 2 commits into from

Conversation

victorandree
Copy link
Contributor

If a table alias is used for the main table, it's not valid according to the SQL standard to refer to it by its "real name" anymore (see http://www.postgresql.org/docs/8.2/static/queries-table-expressions.html#QUERIES-TABLE-ALIASES).

This causes problems when doing JOIN with a table alias for the "main table", since previous code always used the table name. Now, the conditon code checks for presence of a table alias and uses that if available.

If a table alias is used for the main table, it's not valid according
to the SQL standard to refer to it by it's "real name" (see
http://www.postgresql.org/docs/8.2/static/queries-table-expressions.html
#QUERIES-TABLE-ALIASES). This causes problems when doing JOIN with a
table alias for the "main table", since previous code always used table
name. Now, we check for a table alias.
@ghost ghost assigned treffynnon Aug 14, 2013
@treffynnon
Copy link
Collaborator

Thank you for the pull request, code and test. This looks good to merge!

@treffynnon
Copy link
Collaborator

Merged in commit d477a0c

@treffynnon treffynnon closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants