
March 21st, 2012, 02:27 PM
|
|
Registered User
|
|
Join Date: Mar 2012
Posts: 1
Time spent in forums: 32 m 3 sec
Reputation Power: 0
|
|
|
\timing in PL/pgSQL language in SQL file
Hi, I know how timing work in postgresql prompt, how I do is to type \timing.
However, I have created a sql file that is based on PL/pgSQL language, for example, the sql file looks like the following,
CREATE OR REPLACE FUNCTION make_plpgsql()
RETURNS VOID
LANGUAGE SQL
AS $$
CREATE LANGUAGE plpgsql;
$$;
for loop on some tables
\timing <----------------------- gives me error
for loop on some tables...
\timing
$$LANGUAGE plpgsql;
The error is like the following,
psql:test.sql:78: ERROR: syntax error at or near "\"
LINE 39: \timing
^
How do I make timing work in PL/pgSQL language in SQL file? Thank you.
|