okbob / plpgsql_check

plpgsql_check is a linter tool (does source code static analyze) for the PostgreSQL language plpgsql (the native language for PostgreSQL store procedures).
https://groups.google.com/forum/#!forum/postgresql-extensions-hacking
Other
637 stars 53 forks source link

It is not possible to use the possibilities of the profiler #122

Closed sgrinko closed 2 years ago

sgrinko commented 2 years ago

Postgresql 14.5 CentOS 7.9

I use latest plpgsql_check VERSION "2.1"

git clone https://github.com/okbob/plpgsql_check cd plpgsql_check make USE_PGXS=1 clean make USE_PGXS=1 install

Varias of the environment:

postgres=# show shared_preload_libraries;
shared_preload_libraries                                                                                             |
---------------------------------------------------------------------------------------------------------------------+
plpgsql,plpgsql_check,plugin_debugger,pg_stat_statements,auto_explain,pg_buffercache,pg_cron,shared_ispell,pg_prewarm|

postgres=# show plpgsql_check.profiler;
plpgsql_check.profiler|
----------------------+
on                    |

postgres=# show plpgsql_check.profiler_max_shared_chunks;
plpgsql_check.profiler_max_shared_chunks|
----------------------------------------+
15000                                   |

GUC: 
pg_stat_statements
--------------------------------------------
pg_stat_statements.max = 10000
pg_stat_statements.track = all
pg_stat_statements.track_utility = true
pg_stat_statements.track_planning = false
pg_stat_statements.save = true

# - Query and Index Statistics Collector -
------------------------------------------
track_activities = on
track_activity_query_size = 16384
track_counts = on
track_io_timing = on
track_wal_io_timing = on
track_functions = all

# - Monitoring -
----------------------
compute_query_id = on

I create test function:

CREATE OR REPLACE FUNCTION public.fx1(a integer)
 RETURNS integer
 LANGUAGE plpgsql
AS $function$
begin
  if a > 10 then
    raise notice 'ahoj';
    return -1;
  else
    raise notice 'nazdar';
    return 1;
  end if;
end;
$function$

I test:

select pg_stat_statements_reset();

select public.fx1(1);
NOTICE:  nazdar
"fx1"
-----
1

select public.fx1(10)
NOTICE:  nazdar
"fx1"
-----
1

select public.fx1(11);
NOTICE:  ahoj
"fx1"
-----
-1

SELECT queryid, query, calls,rows as total_rows,round(rows/calls) as average_rows,total_exec_time,mean_exec_time,
       min_exec_time, max_exec_time, stddev_exec_time, blk_read_time+blk_write_time as io_time,
       total_exec_time-blk_read_time-blk_write_time as cpu_time,
       round(100.0 * shared_blks_hit / nullif ( shared_blks_hit + shared_blks_read , 0),2) AS hit_percent
FROM pg_stat_statements 
ORDER BY total_exec_time DESC
LIMIT 50;

queryid             |query                                                                                                |calls |total_rows|average_rows|total_exec_time    |mean_exec_time     |min_exec_time       |max_exec_time      |stddev_exec_time    |io_time|cpu_time           |hit_percent|
--------------------+-----------------------------------------------------------------------------------------------------+------+----------+------------+-------------------+-------------------+--------------------+-------------------+--------------------+-------+-------------------+-----------+
 8508857093118547650|select pg_stat_statements_reset()                                                                    |     1|         1|         1.0| 0.9921000000000001| 0.9921000000000001|  0.9921000000000001| 0.9921000000000001|                 0.0|    0.0| 0.9921000000000001|     [NULL]|
 5660945554418948417|select public.fx1($1)                                                                                |     3|         3|         1.0|0.35619999999999996|0.11873333333333333|               0.111|0.12439999999999998|0.005662351298022947|    0.0|0.35619999999999996|     [NULL]|
-9117648439271731270|SELECT format_type(oid,$1) as typname FROM pg_type WHERE oid = $2                                    |     4|         4|         1.0|             0.1452|             0.0363|0.027399999999999997|             0.0537|0.010636493783197544|    0.0|             0.1452|     100.00|
 2071216293906730595|SELECT CASE WHEN typbasetype=$1 THEN oid else typbasetype END AS basetype¶  FROM pg_type WHERE oid=$2|     4|         4|         1.0|             0.0924|             0.0231|               0.019|             0.0339|0.006254998001598402|    0.0|             0.0924|     100.00|

I try to run Profile functions:

select * from plpgsql_profiler_function_tb('fx1(int)');

lineno|stmt_lineno|queryids|cmds_on_row|exec_stmts|exec_stmts_err|total_time|avg_time|max_time|processed_rows|source                    |
------+-----------+--------+-----------+----------+--------------+----------+--------+--------+--------------+--------------------------+
     1|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |                          |
     2|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |begin                     |
     3|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  if a > 10 then          |
     4|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    raise notice 'ahoj';  |
     5|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    return -1;            |
     6|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  else                    |
     7|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    raise notice 'nazdar';|
     8|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    return 1;             |
     9|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  end if;                 |
    10|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |end;                      |

select * from plpgsql_profiler_function_statements_tb('fx1(int)');

stmtid|parent_stmtid|parent_note|block_num|lineno|queryid|exec_stmts|exec_stmts_err|total_time|avg_time|max_time|processed_rows|stmtname       |
------+-------------+-----------+---------+------+-------+----------+--------------+----------+--------+--------+--------------+---------------+
     0|       [NULL]|[NULL]     |        1|     2| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|statement block|
     1|            0|body       |        1|     3| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|IF             |
     2|            1|then body  |        1|     4| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RAISE          |
     3|            1|then body  |        2|     5| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RETURN         |
     4|            1|else body  |        1|     7| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RAISE          |
     5|            1|else body  |        2|     8| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RETURN         |

select * from plpgsql_profiler_functions_all();
funcoid|exec_count|exec_stmts_err|total_time|avg_time|stddev_time|min_time|max_time|
-------+----------+--------------+----------+--------+-----------+--------+--------+

Tell me what I'm doing wrong? How to use Profile capabilities correctly?

okbob commented 2 years ago

Hi

so 3. 9. 2022 v 11:27 odesílatel sergey grinko @.***> napsal:

Postgresql 14.5 CentOS 7.9

I use latest plpgsql_check VERSION "2.1"

git clone https://github.com/okbob/plpgsql_check cd plpgsql_check make USE_PGXS=1 clean make USE_PGXS=1 install

Varias of the environment:

postgres=# show shared_preload_libraries;

shared_preload_libraries |

---------------------------------------------------------------------------------------------------------------------+

plpgsql,plpgsql_check,plugin_debugger,pg_stat_statements,auto_explain,pg_buffercache,pg_cron,shared_ispell,pg_prewarm|

postgres=# show plpgsql_check.profiler;

plpgsql_check.profiler|

----------------------+

on |

postgres=# show plpgsql_check.profiler_max_shared_chunks;

plpgsql_check.profiler_max_shared_chunks|

----------------------------------------+

15000 |

GUC:

pg_stat_statements


pg_stat_statements.max = 10000

pg_stat_statements.track = all

pg_stat_statements.track_utility = true

pg_stat_statements.track_planning = false

pg_stat_statements.save = true

- Query and Index Statistics Collector -


track_activities = on

track_activity_query_size = 16384

track_counts = on

track_io_timing = on

track_wal_io_timing = on

track_functions = all

- Monitoring -


compute_query_id = on

I create test function:

CREATE OR REPLACE FUNCTION public.fx1(a integer)

RETURNS integer

LANGUAGE plpgsql

AS $function$

begin

if a > 10 then

raise notice 'ahoj';

return -1;

else

raise notice 'nazdar';

return 1;

end if;

end;

$function$

I test:

select pg_stat_statements_reset();

select public.fx1(1);

NOTICE: nazdar

"fx1"


1

select public.fx1(10)

NOTICE: nazdar

"fx1"


1

select public.fx1(11);

NOTICE: ahoj

"fx1"


-1

SELECT queryid, query, calls,rows as total_rows,round(rows/calls) as average_rows,total_exec_time,mean_exec_time,

   min_exec_time, max_exec_time, stddev_exec_time, blk_read_time+blk_write_time as io_time,

   total_exec_time-blk_read_time-blk_write_time as cpu_time,

   round(100.0 * shared_blks_hit / nullif ( shared_blks_hit + shared_blks_read , 0),2) AS hit_percent

FROM pg_stat_statements

ORDER BY total_exec_time DESC

LIMIT 50;

queryid |query |calls |total_rows|average_rows|total_exec_time |mean_exec_time |min_exec_time |max_exec_time |stddev_exec_time |io_time|cpu_time |hit_percent|

--------------------+-----------------------------------------------------------------------------------------------------+------+----------+------------+-------------------+-------------------+--------------------+-------------------+--------------------+-------+-------------------+-----------+

8508857093118547650|select pg_stat_statements_reset() | 1| 1| 1.0| 0.9921000000000001| 0.9921000000000001| 0.9921000000000001| 0.9921000000000001| 0.0| 0.0| 0.9921000000000001| [NULL]|

5660945554418948417|select public.fx1($1) | 3| 3| 1.0|0.35619999999999996|0.11873333333333333| 0.111|0.12439999999999998|0.005662351298022947| 0.0|0.35619999999999996| [NULL]|

-9117648439271731270|SELECT format_type(oid,$1) as typname FROM pg_type WHERE oid = $2 | 4| 4| 1.0| 0.1452| 0.0363|0.027399999999999997| 0.0537|0.010636493783197544| 0.0| 0.1452| 100.00|

2071216293906730595|SELECT CASE WHEN typbasetype=$1 THEN oid else typbasetype END AS basetype¶ FROM pg_type WHERE oid=$2| 4| 4| 1.0| 0.0924| 0.0231| 0.019| 0.0339|0.006254998001598402| 0.0| 0.0924| 100.00|

I try to run Profile functions:

select * from plpgsql_profiler_function_tb('fx1(int)');

lineno|stmt_lineno|queryids|cmds_on_row|exec_stmts|exec_stmts_err|total_time|avg_time|max_time|processed_rows|source |

------+-----------+--------+-----------+----------+--------------+----------+--------+--------+--------------+--------------------------+

 1|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |                          |

 2|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |begin                     |

 3|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  if a > 10 then          |

 4|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    raise notice 'ahoj';  |

 5|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    return -1;            |

 6|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  else                    |

 7|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    raise notice 'nazdar';|

 8|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    return 1;             |

 9|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  end if;                 |

10|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |end;                      |

select * from plpgsql_profiler_function_statements_tb('fx1(int)');

stmtid|parent_stmtid|parent_note|block_num|lineno|queryid|exec_stmts|exec_stmts_err|total_time|avg_time|max_time|processed_rows|stmtname |

------+-------------+-----------+---------+------+-------+----------+--------------+----------+--------+--------+--------------+---------------+

 0|       [NULL]|[NULL]     |        1|     2| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|statement block|

 1|            0|body       |        1|     3| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|IF             |

 2|            1|then body  |        1|     4| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RAISE          |

 3|            1|then body  |        2|     5| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RETURN         |

 4|            1|else body  |        1|     7| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RAISE          |

 5|            1|else body  |        2|     8| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RETURN         |

select * from plpgsql_profiler_functions_all();

funcoid|exec_count|exec_stmts_err|total_time|avg_time|stddev_time|min_time|max_time|

-------+----------+--------------+----------+--------+-----------+--------+--------+

Tell me what I'm doing wrong? How to use Profile capabilities correctly?

I am afraid that the plpgsql_check profiler doesn't work together with the plugin_debugger.

Unfortunately the plpgsql debug API doesn't allow it to be used by more extensions in one time :(

I'll try to modify plpgsql_check to works with plugin_debugger together - but it needs some time for experimenting

— Reply to this email directly, view it on GitHub https://github.com/okbob/plpgsql_check/issues/122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO42DIUMYWU27Z373LZTV4MKYRANCNFSM6AAAAAAQD2MIHQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

okbob commented 2 years ago

so 3. 9. 2022 v 18:02 odesílatel Pavel Stehule @.***> napsal:

Hi

so 3. 9. 2022 v 11:27 odesílatel sergey grinko @.***> napsal:

Postgresql 14.5 CentOS 7.9

I use latest plpgsql_check VERSION "2.1"

git clone https://github.com/okbob/plpgsql_check cd plpgsql_check make USE_PGXS=1 clean make USE_PGXS=1 install

Varias of the environment:

postgres=# show shared_preload_libraries;

shared_preload_libraries |

---------------------------------------------------------------------------------------------------------------------+

plpgsql,plpgsql_check,plugin_debugger,pg_stat_statements,auto_explain,pg_buffercache,pg_cron,shared_ispell,pg_prewarm|

postgres=# show plpgsql_check.profiler;

plpgsql_check.profiler|

----------------------+

on |

postgres=# show plpgsql_check.profiler_max_shared_chunks;

plpgsql_check.profiler_max_shared_chunks|

----------------------------------------+

15000 |

GUC:

pg_stat_statements


pg_stat_statements.max = 10000

pg_stat_statements.track = all

pg_stat_statements.track_utility = true

pg_stat_statements.track_planning = false

pg_stat_statements.save = true

- Query and Index Statistics Collector -


track_activities = on

track_activity_query_size = 16384

track_counts = on

track_io_timing = on

track_wal_io_timing = on

track_functions = all

- Monitoring -


compute_query_id = on

I create test function:

CREATE OR REPLACE FUNCTION public.fx1(a integer)

RETURNS integer

LANGUAGE plpgsql

AS $function$

begin

if a > 10 then

raise notice 'ahoj';

return -1;

else

raise notice 'nazdar';

return 1;

end if;

end;

$function$

I test:

select pg_stat_statements_reset();

select public.fx1(1);

NOTICE: nazdar

"fx1"


1

select public.fx1(10)

NOTICE: nazdar

"fx1"


1

select public.fx1(11);

NOTICE: ahoj

"fx1"


-1

SELECT queryid, query, calls,rows as total_rows,round(rows/calls) as average_rows,total_exec_time,mean_exec_time,

   min_exec_time, max_exec_time, stddev_exec_time, blk_read_time+blk_write_time as io_time,

   total_exec_time-blk_read_time-blk_write_time as cpu_time,

   round(100.0 * shared_blks_hit / nullif ( shared_blks_hit + shared_blks_read , 0),2) AS hit_percent

FROM pg_stat_statements

ORDER BY total_exec_time DESC

LIMIT 50;

queryid |query |calls |total_rows|average_rows|total_exec_time |mean_exec_time |min_exec_time |max_exec_time |stddev_exec_time |io_time|cpu_time |hit_percent|

--------------------+-----------------------------------------------------------------------------------------------------+------+----------+------------+-------------------+-------------------+--------------------+-------------------+--------------------+-------+-------------------+-----------+

8508857093118547650|select pg_stat_statements_reset() | 1| 1| 1.0| 0.9921000000000001| 0.9921000000000001| 0.9921000000000001| 0.9921000000000001| 0.0| 0.0| 0.9921000000000001| [NULL]|

5660945554418948417|select public.fx1($1) | 3| 3| 1.0|0.35619999999999996|0.11873333333333333| 0.111|0.12439999999999998|0.005662351298022947| 0.0|0.35619999999999996| [NULL]|

-9117648439271731270|SELECT format_type(oid,$1) as typname FROM pg_type WHERE oid = $2 | 4| 4| 1.0| 0.1452| 0.0363|0.027399999999999997| 0.0537|0.010636493783197544| 0.0| 0.1452| 100.00|

2071216293906730595|SELECT CASE WHEN typbasetype=$1 THEN oid else typbasetype END AS basetype¶ FROM pg_type WHERE oid=$2| 4| 4| 1.0| 0.0924| 0.0231| 0.019| 0.0339|0.006254998001598402| 0.0| 0.0924| 100.00|

I try to run Profile functions:

select * from plpgsql_profiler_function_tb('fx1(int)');

lineno|stmt_lineno|queryids|cmds_on_row|exec_stmts|exec_stmts_err|total_time|avg_time|max_time|processed_rows|source |

------+-----------+--------+-----------+----------+--------------+----------+--------+--------+--------------+--------------------------+

 1|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |                          |

 2|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |begin                     |

 3|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  if a > 10 then          |

 4|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    raise notice 'ahoj';  |

 5|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    return -1;            |

 6|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  else                    |

 7|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    raise notice 'nazdar';|

 8|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |    return 1;             |

 9|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |  end if;                 |

10|     [NULL]|NULL    |     [NULL]|    [NULL]|        [NULL]|    [NULL]|  [NULL]|NULL    |NULL          |end;                      |

select * from plpgsql_profiler_function_statements_tb('fx1(int)');

stmtid|parent_stmtid|parent_note|block_num|lineno|queryid|exec_stmts|exec_stmts_err|total_time|avg_time|max_time|processed_rows|stmtname |

------+-------------+-----------+---------+------+-------+----------+--------------+----------+--------+--------+--------------+---------------+

 0|       [NULL]|[NULL]     |        1|     2| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|statement block|

 1|            0|body       |        1|     3| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|IF             |

 2|            1|then body  |        1|     4| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RAISE          |

 3|            1|then body  |        2|     5| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RETURN         |

 4|            1|else body  |        1|     7| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RAISE          |

 5|            1|else body  |        2|     8| [NULL]|         0|             0|       0.0|  [NULL]|     0.0|             0|RETURN         |

select * from plpgsql_profiler_functions_all();

funcoid|exec_count|exec_stmts_err|total_time|avg_time|stddev_time|min_time|max_time|

-------+----------+--------------+----------+--------+-----------+--------+--------+

Tell me what I'm doing wrong? How to use Profile capabilities correctly?

I am afraid that the plpgsql_check profiler doesn't work together with the plugin_debugger.

Unfortunately the plpgsql debug API doesn't allow it to be used by more extensions in one time :(

I'll try to modify plpgsql_check to works with plugin_debugger together - but it needs some time for experimenting

Unfortunately, it is not possible. Just this API doesn't support it - and I cannot change it on the extension side.

Regards

Pavel

— Reply to this email directly, view it on GitHub https://github.com/okbob/plpgsql_check/issues/122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO42DIUMYWU27Z373LZTV4MKYRANCNFSM6AAAAAAQD2MIHQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sgrinko commented 2 years ago

Thank you for the quick response. Thank you!

okbob commented 2 years ago

ne 4. 9. 2022 v 8:05 odesílatel sergey grinko @.***> napsal:

Thank you for the quick response.

After some thinking I found a solution that should work. Can you compile and check plpgsql_check from the master branch?

It should be initialized after debugger_plugin

(2022-09-04 13:03:21) postgres=# show shared_preload_libraries ; ┌────────────────────────────────┐ │ shared_preload_libraries │ ╞════════════════════════════════╡ │ plugin_debugger, plpgsql_check │ └────────────────────────────────┘ (1 row)

Please, can you check if the debugger is still working?

Thank you!

— Reply to this email directly, view it on GitHub https://github.com/okbob/plpgsql_check/issues/122#issuecomment-1236267105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO43J5VRAOPGILZ4ZAD3V4Q3Z3ANCNFSM6AAAAAAQD2MIHQ . You are receiving this because you commented.Message ID: @.***>

sgrinko commented 2 years ago

I tried to compile the latest version, but received compilation errors:

gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal  -D_GNU_SOURCE -I/usr/in
In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,
                 from /usr/pgsql-14/include/server/executor/tuptable.h:18,
                 from /usr/pgsql-14/include/server/access/tupconvert.h:20,
                 from /usr/pgsql-14/include/server/nodes/execnodes.h:17,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/plpgsql_check.c:26:
/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:
/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]
 PageValidateSpecialPointer(Page page)
                                 ^
In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/plpgsql_check.c:26:
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_next_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:
/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_prev_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 slist_next_node(slist_head *head, slist_node *node)
                             ^
gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal  -D_GNU_SOURCE -I/usr/in
In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,
                 from /usr/pgsql-14/include/server/executor/tuptable.h:18,
                 from /usr/pgsql-14/include/server/access/tupconvert.h:20,
                 from /usr/pgsql-14/include/server/nodes/execnodes.h:17,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/expr_walk.c:12:
/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:
/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]
 PageValidateSpecialPointer(Page page)
                                 ^
In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/expr_walk.c:12:
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_next_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:
/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_prev_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 slist_next_node(slist_head *head, slist_node *node)
                             ^
gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal  -D_GNU_SOURCE -I/usr/in
In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,
                 from /usr/pgsql-14/include/server/executor/tuptable.h:18,
                 from /usr/pgsql-14/include/server/access/tupconvert.h:20,
                 from /usr/pgsql-14/include/server/nodes/execnodes.h:17,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/assign.c:12:
/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:
/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]
 PageValidateSpecialPointer(Page page)
                                 ^
In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/assign.c:12:
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_next_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:
/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_prev_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 slist_next_node(slist_head *head, slist_node *node)
                             ^
gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal  -D_GNU_SOURCE -I/usr/in
In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,
                 from /usr/pgsql-14/include/server/executor/tuptable.h:18,
                 from /usr/pgsql-14/include/server/access/tupconvert.h:20,
                 from /usr/pgsql-14/include/server/nodes/execnodes.h:17,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/profiler.c:11:
/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:
/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]
 PageValidateSpecialPointer(Page page)
                                 ^
In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,
                 from /usr/pgsql-14/include/server/commands/trigger.h:17,
                 from /usr/pgsql-14/include/server/plpgsql.h:21,
                 from src/plpgsql_check.h:3,
                 from src/profiler.c:11:
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_next_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:
/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 dlist_prev_node(dlist_head *head, dlist_node *node)
                             ^
/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:
/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]
 slist_next_node(slist_head *head, slist_node *node)
                             ^
src/profiler.c: In function ‘profiler_stmt_walker’:
src/profiler.c:924:20: warning: unused variable ‘profile’ [-Wunused-variable]
  profiler_profile *profile = pinfo->profile;
                    ^
src/profiler.c: In function ‘plpgsql_check_profiler_func_init’:
src/profiler.c:2814:22: error: ‘PLpgSQL_plugin’ has no member named ‘assign_value’
   prev_plpgsql_plugin->assign_value = (*plpgsql_check_plugin_var_ptr)->assign_value;
                      ^
src/profiler.c:2814:70: error: ‘PLpgSQL_plugin’ has no member named ‘assign_value’
   prev_plpgsql_plugin->assign_value = (*plpgsql_check_plugin_var_ptr)->assign_value;
                                                                      ^
src/profiler.c:2815:22: error: ‘PLpgSQL_plugin’ has no member named ‘eval_datum’
   prev_plpgsql_plugin->eval_datum = (*plpgsql_check_plugin_var_ptr)->eval_datum;
                      ^
src/profiler.c:2815:68: error: ‘PLpgSQL_plugin’ has no member named ‘eval_datum’
   prev_plpgsql_plugin->eval_datum = (*plpgsql_check_plugin_var_ptr)->eval_datum;
                                                                    ^
src/profiler.c:2816:22: error: ‘PLpgSQL_plugin’ has no member named ‘cast_value’
   prev_plpgsql_plugin->cast_value = (*plpgsql_check_plugin_var_ptr)->cast_value;
                      ^
src/profiler.c:2816:68: error: ‘PLpgSQL_plugin’ has no member named ‘cast_value’
   prev_plpgsql_plugin->cast_value = (*plpgsql_check_plugin_var_ptr)->cast_value;
                                                                    ^
make: *** [src/profiler.o] Error 1
okbob commented 2 years ago

ne 4. 9. 2022 v 22:56 odesílatel sergey grinko @.***> napsal:

I tried to copy the latest version, but received compilation errors:

gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal -D_GNU_SOURCE -I/usr/in

In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,

             from /usr/pgsql-14/include/server/executor/tuptable.h:18,

             from /usr/pgsql-14/include/server/access/tupconvert.h:20,

             from /usr/pgsql-14/include/server/nodes/execnodes.h:17,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/plpgsql_check.c:26:

/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:

/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]

PageValidateSpecialPointer(Page page)

                             ^

In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/plpgsql_check.c:26:

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_next_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:

/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_prev_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]

slist_next_node(slist_head head, slist_node node)

                         ^

gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal -D_GNU_SOURCE -I/usr/in

In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,

             from /usr/pgsql-14/include/server/executor/tuptable.h:18,

             from /usr/pgsql-14/include/server/access/tupconvert.h:20,

             from /usr/pgsql-14/include/server/nodes/execnodes.h:17,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/expr_walk.c:12:

/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:

/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]

PageValidateSpecialPointer(Page page)

                             ^

In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/expr_walk.c:12:

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_next_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:

/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_prev_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]

slist_next_node(slist_head head, slist_node node)

                         ^

gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal -D_GNU_SOURCE -I/usr/in

In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,

             from /usr/pgsql-14/include/server/executor/tuptable.h:18,

             from /usr/pgsql-14/include/server/access/tupconvert.h:20,

             from /usr/pgsql-14/include/server/nodes/execnodes.h:17,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/assign.c:12:

/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:

/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]

PageValidateSpecialPointer(Page page)

                             ^

In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/assign.c:12:

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_next_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:

/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_prev_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]

slist_next_node(slist_head head, slist_node node)

                         ^

gcc -std=gnu99 -Wextra -g -fPIC -I/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -Wall -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal -D_GNU_SOURCE -I/usr/in

In file included from /usr/pgsql-14/include/server/access/htup_details.h:21:0,

             from /usr/pgsql-14/include/server/executor/tuptable.h:18,

             from /usr/pgsql-14/include/server/access/tupconvert.h:20,

             from /usr/pgsql-14/include/server/nodes/execnodes.h:17,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/profiler.c:11:

/usr/pgsql-14/include/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:

/usr/pgsql-14/include/server/storage/bufpage.h:313:33: warning: unused parameter ‘page’ [-Wunused-parameter]

PageValidateSpecialPointer(Page page)

                             ^

In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:20:0,

             from /usr/pgsql-14/include/server/commands/trigger.h:17,

             from /usr/pgsql-14/include/server/plpgsql.h:21,

             from src/plpgsql_check.h:3,

             from src/profiler.c:11:

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:440:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_next_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘dlist_prev_node’:

/usr/pgsql-14/include/server/lib/ilist.h:450:29: warning: unused parameter ‘head’ [-Wunused-parameter]

dlist_prev_node(dlist_head head, dlist_node node)

                         ^

/usr/pgsql-14/include/server/lib/ilist.h: In function ‘slist_next_node’:

/usr/pgsql-14/include/server/lib/ilist.h:641:29: warning: unused parameter ‘head’ [-Wunused-parameter]

slist_next_node(slist_head head, slist_node node)

                         ^

src/profiler.c: In function ‘profiler_stmt_walker’:

src/profiler.c:924:20: warning: unused variable ‘profile’ [-Wunused-variable]

profiler_profile *profile = pinfo->profile;

                ^

src/profiler.c: In function ‘plpgsql_check_profiler_func_init’:

src/profiler.c:2814:22: error: ‘PLpgSQL_plugin’ has no member named ‘assign_value’

prev_plpgsql_plugin->assign_value = (*plpgsql_check_plugin_var_ptr)->assign_value;

                  ^

src/profiler.c:2814:70: error: ‘PLpgSQL_plugin’ has no member named ‘assign_value’

prev_plpgsql_plugin->assign_value = (*plpgsql_check_plugin_var_ptr)->assign_value;

                                                                  ^

src/profiler.c:2815:22: error: ‘PLpgSQL_plugin’ has no member named ‘eval_datum’

prev_plpgsql_plugin->eval_datum = (*plpgsql_check_plugin_var_ptr)->eval_datum;

                  ^

src/profiler.c:2815:68: error: ‘PLpgSQL_plugin’ has no member named ‘eval_datum’

prev_plpgsql_plugin->eval_datum = (*plpgsql_check_plugin_var_ptr)->eval_datum;

                                                                ^

src/profiler.c:2816:22: error: ‘PLpgSQL_plugin’ has no member named ‘cast_value’

prev_plpgsql_plugin->cast_value = (*plpgsql_check_plugin_var_ptr)->cast_value;

                  ^

src/profiler.c:2816:68: error: ‘PLpgSQL_plugin’ has no member named ‘cast_value’

prev_plpgsql_plugin->cast_value = (*plpgsql_check_plugin_var_ptr)->cast_value;

                                                                ^

make: *** [src/profiler.o] Error 1

The warnings are not related to plpgsql_check. The error should be fixed now.

— Reply to this email directly, view it on GitHub https://github.com/okbob/plpgsql_check/issues/122#issuecomment-1236413907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO45AES7EQIPH54FTL53V4UEJRANCNFSM6AAAAAAQD2MIHQ . You are receiving this because you modified the open/close state.Message ID: @.***>

sgrinko commented 2 years ago

I checked everything. The functions of the profiler work! The functions of the debugger are working!

shared_preload_libraries = 'plugin_debugger,plpgsql,plpgsql_check,pg_stat_statements,auto_explain,pg_buffercache,pg_cron,shared_ispell,pg_prewarm' 

Thank you!

okbob commented 2 years ago

po 5. 9. 2022 v 10:58 odesílatel sergey grinko @.***> napsal:

I checked everything. The functions of the profiler work! The functions of the debugger are working!

shared_preload_libraries = 'plugin_debugger,plpgsql,plpgsql_check,pg_stat_statements,auto_explain,pg_buffercache,pg_cron,shared_ispell,pg_prewarm'

super,

Thank you for check

Regards

Pavel

Thank you!

— Reply to this email directly, view it on GitHub https://github.com/okbob/plpgsql_check/issues/122#issuecomment-1236725456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO435VWKA6DZY7HKHWJ3V4WYZVANCNFSM6AAAAAAQD2MIHQ . You are receiving this because you modified the open/close state.Message ID: @.***>