Are all kinds of procedural code (stored procedure, functions, views and triggers) stored on database or database management system server, once created, regardless of how they are created (for example, typing their definitions interactively in a command-line client of the database management system)? I am asking this because
- in the command-line client of a RDBMS (such as postgresql, mysql, server sql), when typing a query statement, the query statement isn't stored any where.
- in an interactive command-line REPL for a general purpose programming language, when typing the definition of a function or procedure, the function or procedure will not exist after closing the session of the REPL.
How are procedures, functions and triggers and views stored?
Are they stored per table, per database or per database management system server?
If they are stored per database, are they stored in a separate table from the tables that store the actual data and are in the same database? For example, in every database, besides those tables which store the actual data, is there a table which stores the stored procedures of the database, a table the functions of the database, a table the views of the database, and a table the triggers of the database?
Similar questions if they are stored per table, or per database management system server.
Thanks.
来源:https://stackoverflow.com/questions/48113934/are-all-kinds-of-procedural-code-stored-on-server-side-once-created-how-are-th