Re: Command to execute SQL string

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: Łukasz Jarych <jaryszek(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Command to execute SQL string
Date: 2018-03-08 13:14:38
Message-ID: CAKFQuwYH9YQfHn4rHa6afrAE0LKBPdroP2r24yA8Sd+eUNssDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, March 8, 2018, Francisco Olarte <folarte(at)peoplecall(dot)com> wrote:
>
> On Thu, Mar 8, 2018 at 1:26 PM, Łukasz Jarych <jaryszek(at)gmail(dot)com> wrote:
> > i have a table when i have string in each row,
> > for example "DELETE FROM t_test WHERE ID = 3".
> >
> > I want to execute for each row this command.
> > It is possible?
>
> I supose you mean execute the command contained in each row. Anyway,
> it is easy with a procedure, look for example at
>
> https://www.postgresql.org/docs/10/static/plpgsql-statements.html#PLPGSQL-
> STATEMENTS-EXECUTING-DYN
>
>
See also v10 psql \gexec

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-03-08 15:30:03 Re: What is the meaning of pg_restore output?
Previous Message Łukasz Jarych 2018-03-08 12:53:22 Re: Trigger to create string to inverse SQL statement