Open ricardojmendez opened 10 years ago
ricardo, I've hacked together what may be a working fix for this. Could you try https://github.com/budu/lobos/pull/75 to see if it fixes your case?
Hi Jonathan,
It doesn't. From an initial inspection it seems that what's passed to the compile function you modified on postgresql.clj is the DataTypeClause contained in the :data-type section of the map created on compiler.clj.
(Just getting familiar with the lobos codebase)
For what it's worth, there are tests for alter table in postgresql and they are currently failing:
ERROR in (test-alter-table-postgresql) (QueryExecutorImpl.java:2198) Uncaught exception, not in assertion. expected: nil actual: org.postgresql.util.PSQLException: ERROR: syntax error at or near "VARCHAR"
I know my initial pull request was faulty. Did you test the revised version?
Both versions of the pull request were passing the Travis CI build and test, but the CI server isn't testing the postgres driver..
"It doesn't. From an initial inspection it seems that what's passed to the compile function you modified on postgresql.clj is the DataTypeClause contained in the :data-type section of the map created on compiler.clj."
Yeah, that was my initial pull request. The fixed version modifies the method on [:postgreslql DataTypeClause] to add the "TYPE" keyword after the identifier and before the data type.
I don't believe I saw the second one... I'll try it later today. Cheers!
Any luck?
Hi Jonathan,
No time to test yet - busy on an unrelated client project - but I'll give it a shot in a few days and report back.
Confirmed, #75 fixes it.
Good to hear. It really is an ad-hoc patch, though. I think lobos needs to be modified so that it can pass a more general context map down to the lowest level emitters in the compilation blocks.
Really, it looks like lobos could use quite a bit of elaboration to support lots more kinds of table and column alterations.
Running a test on posgres 9.3.5 using:
Created a table with:
Then tried to modify the column:
But that raises a Postgres error. It seems lobos is sending:
when it should be sending