Pregunta

I am facing a problem while executing a Function written using PL/pgSQL. The problem that I am facing is that when I execute the function manually using pgAdmin, the functions gets executed and the data gets loaded into the destination table. But when I execute the same function using a scheduler which has been developed by our team to execute all the different kinds of functions and ETLs based on the requirements, the postgreSQL function executes but doesn't COMMIT the data into the table. If we give a COMMIT statement after the function execution statement, only then the data gets committed.

Can any one suggest me what could be the possible reason for this behaviour of the function which get committed while executing manually but not when executed in a scheduler?

I would be highly obliged if someone can help me with this at the earliest.

Thanks in advance.

¿Fue útil?

Solución

By default, postgresql operates in autocommit mode. That means that each SQL statement you execute Is immediately committed. This is what happens when you execute command using tools such as pgadmin or psql, assuming you do not execute BEGIN first.

I am guessing your scheduler framework is executing BEGIN before starting your job and that it expects you to commit the work as part of the job.

Without knowing more details about the scheduler it is impossible to be more specific.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top