A mathematical solution of the two-dimensional linear problem of an acoustic-gravity wave interacting with a rectangular trench, in a compressible ocean, is presented. Expressions for the flow field on both sides of the trench are derived. The dynamic bottom pressure produced by the acoustic-gravity waves on both sides of the trench is measurable, though on the transmission side it decreases with the trench depth. A successful recording of the bottom pressures could assist in the early detection of tsunami