I would like to ask if it is possible to process the dropping table command and break it if some conditions are not met?
I'm going to assume that you are trying to ask:
How can I prevent DROP TABLE from succeeding based on specific application conditions
DROP TABLE
If so, your only built-in option is to use permissions. See GRANT and REVOKE in the PostgreSQL manual.
GRANT
REVOKE
If you need something more complex, you can write ProcessUtility_hook , but for this you need to write a C extension that is compiled and uploaded to the server.
ProcessUtility_hook
The ProcessUtility_hook entry is actually not too complicated, but there are differences between the PostgreSQL 9.2 and 9.3 definitions, which mean you will need separate extensions. Here is a basic example: https://github.com/ringerc/scrapcode/tree/master/postgresql/example_processutility_hook , and here is a ProcessUtility hook that really does something useful: https://github.com/ringerc/postgres/blob /bdr-reject-unsafe-commands/contrib/bdr/bdr_commandfilter.c
If you have no C programming experience and some time, ProcessUtility_hook not for you.
See also: How to prevent table deletion?
Source: https://habr.com/ru/post/1488468/More articles:Best practice for fixing bug fixes in both the core and industry - gitThe most efficient way to subset data is performanceHow to prevent table fall? - postgresqlSSRS 2008 does not provide a report - reporting-servicesregex negative look around with two adjacent matches - javascriptMininet Cannot find required executable controller - pythonWhat is the best practice for abstract classes with overrides that return nothing - designJquery Validate: calling a validation method in another method - jquerySpring - SessionFactoryUtils in sleep mode 4 - javaList with multiple values ββper key - listAll Articles