Будничный хаос и мрак при поддержке ИТ систем.
DB=# explain update table1 set column = True from table1 t1 join table2 t2 on t2.id = t1.id where t1.id < 100000 and t2.column in (0, 4) and t12bool;
Update on table1 (cost=159112.16..2527607960.95 rows=202168723468 width=48)
-> Nested Loop (cost=159112.16..2527607960.95 rows=202168723468 width=48)
-> Seq Scan on table1 (cost=0.00..199305.87 rows=8276887 width=35)
-> Materialize (cost=159112.16..268192.87 rows=24426 width=12)
... skipped ...
DB=# explain update table1 t1 set column = True from table2 t2 where t2.id = t1.id and t1.id < 100000 and t2.column in (0, 4) and t2.bool;
Update on synonyms s (cost=159112.16..268440.74 rows=24426 width=42)
-> Hash Join (cost=159112.16..268440.74 rows=24426 width=42)
Hash Cond: (s.entity_id = e.id)
... skipped ...
Note that the target table must not appear in the from_list, unless you intend a self-join
grant select on all tables in schema public to user, есть вероятность запутаться. Создаем роль create role schema_readgrant all privileges on all tables in schema public to schema_readgrant all privileges on all sequences in schema public to schema_read\ddp запроса в постгресе. Добавим-ка нашей роли права на чтение всех новых таблиц и последовательностей:alter default privileges in schema public grant select on tables to schema_read;alter default privileges in schema public grant select on sequences to schema_read;grant schema_read to userpublic схема, то выдайте еще права роли на ее использование:grant usage on schema schema_name to schema_read./kafka-move-leadership.sh --broker-id 2 --first-broker-id 1 --last-broker-id 3 --zookeeper localhost:2181 > ~/ld.json./kafka/bin/kafka-reassign-partitions.sh --zookeeper localhost:2181 --reassignment-json-file ld.json --executelua_need_request_body on;
set $request_headers "";
set $resp_body "";
body_filter_by_lua '
local resp_body = string.sub(ngx.arg[1], 1, 1000)
ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body
if ngx.arg[2] then
ngx.var.resp_body = ngx.ctx.buffered
end
local h = ngx.req.get_headers()
local request_headers = ""
for k, v in pairs(h) do
request_headers = request_headers .. k .. ":" .. v
end
ngx.ctx.buffered = (ngx.ctx.buffered or "") .. request_headers
if ngx.arg[2] then
ngx.var.request_headers = ngx.ctx.buffered
end
';
format bodylog '$remote_addr - $remote_user [$time_local] 'используем в access_log.
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body"> <"$resp_body"> <"$request_headers">';
И
p -i eth0 -s 0 -A 'host x.x.x.x and tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)'
Выглядит примерно так:
access_by_lua '
-- Try POST first
ngx.req.read_body();
local args, err = ngx.req.get_post_args();
if next(args) == nil
then
-- Since post is empty, use GET
args, err = ngx.req.get_uri_args();
end
local uri = ngx.var.uri;
local matched = string.find(uri, "needed-method");
local some_arg = args["some_arg"];
if (matched ~= nil and (nil == some_arg or "" == some_arg or string.find(some_arg, "^arg-value$")))
then
ngx.exec("@proxy");
end
';
27.97.240.25 - - [26/Feb/2018:08:05:35 -0800] "\xEF6\xF0\xF1p\xDC\xD8\x9A\xDE\xD6\xF6" 400 166 "-" "-" "-" - 0.710