Cyprich.com

Occasionally Relevant Insights from a Software Builder

By

Programming Advice from Mark Twain

The secret of getting started is breaking your complex, overwhelming tasks into small manageable tasks, and then starting on the first one.
Mark Twain

Software engineering tips from Mark Twain? Not originally planned as such, but it really is good advice for building large applications.

By

Postgres: column “field” does not exist

When I run the following SQL command in PostgreSQL:

select * from projects where Status=’Inactive’

I get the following error:

ERROR: column “status” does not exist

This is a very frustrating and confusing error because the same SQL command works in MS SQL Server and MySQL. After some research, I discovered that Postgres converts all column names in a table to lower case in a SQL query.

The problem can be fixed by enclosed a table name that has mixed case with double quotation marks:

select * from projects where “Status”=’Inactive’

The query will then work as expected.