Pressure just before the hole in a draining tank I get extremely confused in fluid dynamics problem where the pressure in some points is required.
Consider the ideal fluid in the tank in the following picture. I would like to understand what is the pressure of the fluid in the point a. under the condition of steady flow ($A_1 \gg A_2$). The point a. is located immediately before the start of the hole, so it is still contained in the tank.

My guess: In such problems, where the fluid in the tank is considered to not move at all, I can treat the tank as a static fluid, and the fluid in the tube as a fluid in motion. That means that the pressure in $a.$ is $P_a=P_1+\rho g h$, while the pressure in $b.$, from Bernoulli and continuity equation, is $P_b=P_2$, since $v_b=v_2$ and $h_b=h_2$.
Of course there are very big approximations here, but is this the correct way to think about the problem in the limits of steady flow?
The other option would be that the velocity in $a.$ is equal to $v_b$, but in that case it would be $P_a=P_b=P_2$, from Bernoulli equation, which is even more strange.

If I meet the same problem with a fluid which is not ideal, still incompressible but with viscosity $\eta \neq 0$, would anything change? Would the consideration $P_a=\rho g h +P_1$ still be valid?
 A: In your approximation there is a velocity discontinuity where the pipe joins the container. Assuming that is a good approximation then you are correct and $P_a=P_b+\rho v^2/2$. In real life though, the pressure will change smoothly because the closer you get to the pipe, the larger the effect of the motion of the water inside the tank.
A: Your guess is correct.  I think you are expected to assume that $a$ is sufficiently far from the hole that $v_a=0$.  If the question does not ask you to make this assumption you should state it explicitly yourself.
It does not follow that there is a discontinuity in velocity at the hole just because there is a discontinuous change in cross-section.  Velocity changes smoothly and continuously throughout the fluid.  It changes from $0$ to $v_b$ within a short distance from the hole.
The assumption that $v_a=0$ gives the same result for $P_a$ even if the fluid is viscous, because viscosity only makes a difference when the fluid is moving.  In this case $P_b\neq P_2$ since a pressure gradient is required to make a viscous fluid flow.
A: Your assumption is correct. At point (a), assuming the liquid is static, the pressure is:
P = (H x SG)/2.31
Where: P = pressure in PSI: 
       SG = Liquid specific gravity
However, at point (B), there is a dynamic component and some of the pressure energy P is converted to velocity energy (hv).
hv = (V^2/2g) where:
hv = Velocity head in feet of liquid. 
V = Velocity of the liquid in (ft/sec). 
g = Gravitation constant 32.2 (ft/sec^2)
The pressure at point (a) = pressure at point (b) + hv
