billelev
asked on
when I post a query into PgAdmin I get an error, but when I type it I do not. Why?
I have a query
ALTER TABLE tbl_trades_all RENAME CO LUMN "StlD ate" TO st ldate;
that I paste into the query editor. When I paste it, I get the following error:
ERROR: syntax error at or near "ALTER TABLE tbl_trades_al l RENAME C OLUMN "
LINE 1: ALTER TABLE tbl_trades_all RENAME CO LUMN "StlD ate" TO st ldat...
^
********** Error **********
ERROR: syntax error at or near "ALTER TABLE tbl_trades_al l RENAME C OLUMN "
SQL state: 42601
Character: 1
However, if I type the query, it works. Does anyone know why?
ALTER TABLE tbl_trades_all
that I paste into the query editor. When I paste it, I get the following error:
ERROR: syntax error at or near "ALTER TABLE tbl_trades_al
LINE 1: ALTER TABLE tbl_trades_all
^
********** Error **********
ERROR: syntax error at or near "ALTER TABLE tbl_trades_al
SQL state: 42601
Character: 1
However, if I type the query, it works. Does anyone know why?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try ope a New Test file, past your string in there, Save As and change the type/encoding to ANSI.
Reopen that file, copy the string from it and paste in PGADMIN must work.
Reopen that file, copy the string from it and paste in PGADMIN must work.
ASKER
The method I found that worked was to paste the text into my google search bar first...Nice!
Similar thing and as I mentioned the failure in PGADMIN is due to the UNICODE caracters in your clipbord and the fix/workaround is to convert them to text by saving them to a text file or as you found in google serach bar or like in a Outlook Subject line on a new email. All these will do same thing - convert your unicode into ansi or utf8 to match PGADMIN encoding.
ASKER
What would a 100% ANSI text file be? I just tried copying from Windows Notepad and that did not work.