You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
I'd probably introduce SQL language "functions" first and describe them (and SQL generally) as being an imperative language.
Then when introducing pl/pgsql I'd highlight that it is a procedural language and should be chosen when SQL cannot solve the problem at hand - in particular since executing queries with SQL functions can be optimized moreso that queries with pl/pgsql functions.
I seem to recall "stored procedures" having a "standalone transaction context" associated with them while functions always execute within the same transaction as the caller. I'd change the name for 20_stored_procedures.sql for this reason; though I guess it depends on what the target audience is more likely to expect.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion! Currently I just added your comments to "intro"...for splitting the two apart would probably need some more samples for pure SQL functions - do you have something in mind? A PR would be very welcome :)
I'd probably introduce SQL language "functions" first and describe them (and SQL generally) as being an imperative language.
Then when introducing pl/pgsql I'd highlight that it is a procedural language and should be chosen when SQL cannot solve the problem at hand - in particular since executing queries with SQL functions can be optimized moreso that queries with pl/pgsql functions.
I seem to recall "stored procedures" having a "standalone transaction context" associated with them while functions always execute within the same transaction as the caller. I'd change the name for 20_stored_procedures.sql for this reason; though I guess it depends on what the target audience is more likely to expect.
The text was updated successfully, but these errors were encountered: