On Mon, Mar 14, 2016 at 08:41:04PM +0530, Shaan Repswal wrote:
> I tried to format the strings the Python way but... I'm getting this error:-
>
> Traceback (most recent call last):
> File "C:\Python34\prototype_husk.py", line 133, in submit_data
> cur.execute(add_column)
> psycopg2.ProgrammingError: syntax error at or near "26.2"
> LINE 2: ADD 26.2 LTRS int DEFAULT NULL
That is what I have been trying to point out - you can't add
a column named "25.2 LTRS" even if the user entered that
value. You will need code to sanitize user input to become
suitable for column names. I seem to remember you saying you
already have such code ?
Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346