pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
echo work alike in SQL
2+ messages / 2 participants
[nested] [flat]

* echo work alike in SQL
@ 2019-08-31 15:45  stan <stanb@panix.com>
  0 siblings, 1 reply; 2+ messages in thread

From: stan @ 2019-08-31 15:45 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Just started using the RAISE functionality to help in debugging.

Tried to add it to an SQL script, only to realize it is a PLPGSQL extension.

Is there a way to get a string to appear in the output f an SQL script?

Can I do some sort of select?

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin





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

* Re: echo work alike in SQL
@ 2019-08-31 16:35  Pavel Stehule <pavel.stehule@gmail.com>
  parent: stan <stanb@panix.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Pavel Stehule @ 2019-08-31 16:35 UTC (permalink / raw)
  To: stan <stanb@panix.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

Hi

so 31. 8. 2019 v 17:46 odesílatel stan <stanb@panix.com> napsal:

> Just started using the RAISE functionality to help in debugging.
>
> Tried to add it to an SQL script, only to realize it is a PLPGSQL
> extension.
>
> Is there a way to get a string to appear in the output f an SQL script?
>
> Can I do some sort of select?
>

if you run SQL script from psql, then you can use \echo

https://www.postgresql.org/docs/current/app-psql.html

elsewhere you should to use SELECT

or you can use own function

CREATE OR REPLACE FUNCTION public.debug_text(text)
 RETURNS text
 LANGUAGE plpgsql
AS $function$
BEGIN
  RAISE NOTICE '%', $1;
  RETURN $1;
END;
$function$

Regards

Pavel


>
> --
> "They that would give up essential liberty for temporary safety deserve
> neither liberty nor safety."
>                                                 -- Benjamin Franklin
>
>
>

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


end of thread, other threads:[~2019-08-31 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31 15:45 echo work alike in SQL stan <stanb@panix.com>
2019-08-31 16:35 ` Pavel Stehule <pavel.stehule@gmail.com>

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