1) долго ли протянет мой hdd при подключении через sata-usb с учётом того, что он никогда не прекращает вращение?
2) можно ли получить доступ к данным SMART при таком подключении?
SELECT evtname as "Name", evtevent as "Event", pg_catalog.pg_get_userbyid(e.evtowner) as "Owner",
case evtenabled when 'O' then 'enabled' when 'R' then 'replica' when 'A' then 'always' when 'D' then 'disabled' end as "Enabled",
e.evtfoid::pg_catalog.regproc as "Procedure", pg_catalog.array_to_string(array(select x from pg_catalog.unnest(evttags) as t(x)), ', ') as "Tags"
FROM pg_catalog.pg_event_trigger e ORDER BY 1
The sub-statements in WITH are executed concurrently with each other and with the main query. Therefore, when using data-modifying statements in WITH, the order in which the specified updates actually happen is unpredictable. All the statements are executed with the same snapshot (see Chapter 13), so they cannot "see" one another's effects on the target tables.
UPDATE "TABLE1"
SET
"Value2" = (NOT EXISTS(
SELECT NULL
FROM "TABLE2"
WHERE "что-то" = "кое-что"
)
AND NOT EXISTS(
SELECT NULL
FROM "TABLE3"
WHERE "что-то" = "кое-что"
))
WHERE "кое-что" = ANY ($1 :: INT [])
Сейчас разработчики пишут портал
created_at < STR_TO_DATE('01.01.2017', '%d.%m.%Y')
melkij=> create type gender as enum('M','W');
CREATE TYPE
melkij=> create table foo (f gender);
CREATE TABLE
melkij=> insert into foo values('M');
INSERT 0 1
melkij=> insert into foo values('F');
ОШИБКА: неверное значение для перечисления gender: "F"
СТРОКА 1: insert into foo values('F');
^
melkij=> insert into foo values('');
ОШИБКА: неверное значение для перечисления gender: ""
СТРОКА 1: insert into foo values('');
create unlogged table list_for_delete (id int);
insert into list_for_delete values ....
with to_rm as (
select id from list_for_delete limit 10000
), rm as (
delete from list_for_delete where id in (select id from to_rm)
)
delete from tablename where id in (select id from to_rm);
vacuum analyze tablename;
drop table list_for_delete ;
postgres=# create schema garage;
CREATE SCHEMA
postgres=# CREATE TABLE garage.users
(
car_id text COLLATE pg_catalog."default"
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
CREATE TABLE
postgres=# insert into garage.users values ('1'), ($$'1'$$), (null);
INSERT 0 3
postgres=# select car_id, car_id is null from garage.users ;
car_id | ?column?
--------+----------
1 | f
'1' | f
| t