DO $$
BEGIN
    IF EXISTS (
        SELECT 1
        FROM information_schema.columns
        WHERE table_name = 'tle'
          AND column_name = 'time_reс'
    ) THEN
        ALTER TABLE tle RENAME COLUMN "time_reс" TO time_rec;
    END IF;
END $$;

ALTER TABLE tle ADD COLUMN IF NOT EXISTS time_rec TIMESTAMP;
