public inbox for [email protected]  
help / color / mirror / Atom feed
stored procedures
2+ messages / 2 participants
[nested] [flat]

* stored procedures
@ 2023-10-17 15:52  Shaozhong SHI <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Shaozhong SHI @ 2023-10-17 15:52 UTC (permalink / raw)
  To: pgsql-sql <[email protected]>

How easily turn do statement scripts into stored procedures?  Much
modification is needed?

What is the advantage to do so?

Regards,

David


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: stored procedures
@ 2023-10-17 16:04  David G. Johnston <[email protected]>
  parent: Shaozhong SHI <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2023-10-17 16:04 UTC (permalink / raw)
  To: Shaozhong SHI <[email protected]>; +Cc: pgsql-sql <[email protected]>

On Tue, Oct 17, 2023 at 8:54 AM Shaozhong SHI <[email protected]>
wrote:

> How easily turn do statement scripts into stored procedures?  Much
> modification is needed?
>
> What is the advantage to do so?
>

Depends on the script but possibly a matter of copy-paste for the simplest.

Advantages: The script is on the server, can require permissions, has a
name (I suppose a script file does too...).  Easier to deal with input
parameters.  Fewer components involved.  Usable by components that can't
issue SQL directly - e.g., GraphQL mutations.

Disadvantages: Changing the script is now a formal migration for the
database instead of an application update.

David J.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-10-17 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17 15:52 stored procedures Shaozhong SHI <[email protected]>
2023-10-17 16:04 ` David G. Johnston <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox