Nothing is wrong with the syntax. If you are using copy/paste, make sure there aren't any special characters in the text.
SELECT * FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information schema';
Open in new window
Are you pasting it in or manually typing it in?
I still say invalid character. If you are using a UTF editor, it might not be a space character you are pasting.
You aren't answering our questions.
Are you physically typing into the psql window or pasting the command into it?
I am pasting query into that.
Then you need to make sure you are pasting what you think you are pasting. Something you are pasting isn't correct.
SELECT * FROM pg_catalog.pg_tables WHERE schemaname <> 'pg_catalog' AND schemaname <> 'information_schema';
Not really sure what to tell you. The syntax is correct.
Something in between what you copy from and when you paste it into the psql window is messing with it.
If you are running psql from a Windows CMD prompt, might be the codepage of the CMD prompt.
You could also save the query to a file, and then just reference the file in the postgres command where you are pasting. Try saving to a file and then referencing the file like:
IT issues often require a personalized solution. With Ask the Experts™, submit your questions to our certified professionals and receive unlimited, customized solutions that work for you.