Why do I need to qualify tables with the schema "public" and double-quote some column names?

61 Views Asked by At

I'm a complete beginner to SQL trying to take an online SQL course. I've followed all the directions based on the class video but for some reason my output queries do not look the same as my instructors.

For example, the instructor has:

SELECT * FROM table1

And for the query to work for me, I have to write:

SELECT * FROM public.table1

It seems like I also have to use quotations when calling certain columns in order for the query to work:

SELECT * FROM public.table1
WHERE "Column1" IS NULL

And when calling columns, have to write:

Select Table1.Column1

Why is this happening and how to fix it? adding "" and public. to everything makes my code look messy and is a pain in the butt to keep typing over and over. My schema is set to public, I'm wondering if that's the issue? Although when I create the table and import from csv, it does not give me any other option except for public.

When I do show search_path, it returns:

"$user", public
0

There are 0 best solutions below