IF OLD.bilet_number IN (SELECT bilet_number FROM all_lends)
хотите удалить этого абонента (и только его), то нужно было делать обычный не INSTEAD) триггер и вместо DELETE оператора в конце сделать RETURN OLD
. CREATE USER user_name PASSWORD (SELECT random_string((SELECT random_int_between(5,15))));
Non-optimizable SQL commands (also called utility commands) are not capable of accepting query parameters. So automatic substitution of PL/pgSQL variables does not work in such commands. To include non-constant text in a utility command executed from PL/pgSQL, you must build the utility command as a string and then EXECUTE it, as discussed in Section 43.5.4.
SELECT random_string(SELECT random_int_between(5,15)) INTO pass;
EXECUTE format('CREATE USER %I PASSWORD %L', user_name, pass);
EXECUTE format('GRANT %I TO %I', role_name, user_name);
Changed in version 2.9: the table and fields names are now quoted. If you need to specify a schema-qualified table please use copy_expert().
// предварительно распарсить json:
// $json = json_decode($response, true);
file_put_contents("file.wav", $json["data"]);
И так получилось что Маше возвращается ID Саши, то есть ID=2;
select * from (
select DISTINCT (regexp_split_to_array(commend, E'\\s+'))[:3] as words from orders
) t
order by words[2]
select client_id, st, en, avg(bal)
from (
select *,
max(day) filter (where l = 1) over (partition by client_id order by day) st,
min(day) filter (where r = 1) over (partition by client_id order by day range between current row and unbounded following) en
from (
select *,
case when (lag(bal) over w) > 0 then 0 else 1 end as l,
case when (lead(bal) over w) > 0 then 0 else 1 end as r
from balance
window w as (partition by client_id order by day)
) t
where bal > 0
) t1 group by client_id, st, en
order by 1, 2
возвращает только верхнее исключение, возникшее внутри самой stack_capture(). Отчего так происходит и можно ли получить весь стек?
my_tb = stack_capture(raising_func)
t = my_tb
while t:
print(t.tb_frame, t.tb_lineno, t.tb_lasti)
t = t.tb_next
SELECT * FROM table1 CROSS JOIN table2
, даже если в таблицах есть такие колонки), но чаще нет. В предикате JOIN ON или в WHERE нужно знать, о колонке какой таблицы идет речь. yum update ca-certificates
или yum reinstall ca-certificates
curl --cacert dummy_xxx https://www.google.com
- должен показать используемую папку с CA сертификатами. 2. su postgres
3. \connect my_table
psql
не забыли?\connect
нужно название БД, по умолчанию подключение идет к БД с именем юзера Linux (т.е. в вашем случае вы подключаетесь к postgres).\l
\dn
\dt sname.
\d sname.my_table