transaction is read-only error
От | Salil Wadnerkar |
---|---|
Тема | transaction is read-only error |
Дата | |
Msg-id | AANLkTinRWYvdgx8uQcgjUvX+zoapk_jGaUvjR5bzPmNv@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: transaction is read-only error
|
Список | pgsql-novice |
Hi, I am experimenting with GNUMed EMR which uses a Mirth (HL7 engine) channel to write data into postgreSQL table (JDBC) and I am getting the error - "transaction is read-only". I think it is because "default_transaction_read_only" is set to true for this database. The javascript (Mirth uses Javascript which it conerts to Java I think) for this is: var dbConn = DatabaseConnectionFactory.createDatabaseConnection('org.postgresql.Driver','jdbc:postgresql://localhost:5432/gnumed_v10','gm-dbo','gm-dbpass'); [some code to calculate the update parameters] sqlquery = "INSERT INTO clin.incoming_data_unmatched (request_id, firstnames, lastnames, dob, postcode, other_info, gender, requestor, data) VALUES ('" + request_id + "', '" + $('patient_firstname') + "', '" + $('patient_lastname') + "', '" + $('patient_dob') + "', '" + postcode + "', '" + other_info + "', '" + $('patient_gender') + "', '" + requestor + "', '" + msg + "')"; result = dbConn.executeUpdate(sqlquery); This last line generates the error. So, I gave superuser permission to this user gm-dbo because I think non-superusers cannot change "default_transaction_read_only" to true. And I added the following lines before this update command: // Salil: added alter database command sqlquery = "alter database gnumed_v10 set default_transaction_read_only to off"; result = dbConn.executeUpdate(sqlquery); But, PostgreSQL generates the error for the executeUpdate of this newly added command now. How should I go about updating the table in this database? regards Salil
В списке pgsql-novice по дате отправления: