libecpg4 is a binary package from the postgresql source. libecpg.so is linked with executables that have been developed with ecpg (Embedded PostgreSQL for C). Documentation on ecpg can be found in the PostgreSQL Programmers' manual which is in the postgresql-doc package.