-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement batch runner for postgresql. #193
base: master
Are you sure you want to change the base?
Conversation
In general it's almost copy/paste of MySqlBatchRunner class. Slight modifications: - changed queries to postgresql syntax UPDATE <what to update> SET <expression> FROM ( <generated select query> ) - slighly modified regular expression with self updates. ColumAlias is optional group now. Alias is not generated every time. - When in TransactionScope it means we have open transaction, really, it is. Postgre treats such transaction as distributed, that's why opening new transaction fails.
Is there any other Relevant Commit or Fork Concerning Postgre SQL? |
- Previously we detected outside transactions using System.Transaction, but recently we overcame the issue using specific configuration of the PgSql devart provider. It's redundant code now and should be removed to make everything consistent with the rest of the code.
@KivraS, I'm not sure I've got your point. You are saying that the generated query by PgSqlBatch runner is incorrect. Right? |
"dbo" is the Schema name, "Transport" is the Table name.
If you run this code on pg Admin on Postgresql 9.3 you get
Correct syntax to work is
I have managed to use your PsqlBatchRunner by altering some lines. Line 122 And similarly for column names and Update queries. |
@KivraS Okay. Clear. Will fix my code. Thanks. |
- Table and column names that are not lowercase are caused the error. So it's necessary to put them in quotes. More info here http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
In general it's almost copy/paste of MySqlBatchRunner class.
Slight modifications:
UPDATE
SET
FROM ( )
ColumAlias is optional group now. Alias is not generated every time.
Postgre treats such transaction as distributed, that's why opening new transaction fails.