Npgsql.Tests.TestBase.CreateSleepCommand C# (CSharp) Method

CreateSleepCommand() protected static method

In PG under 9.1 you can't do SELECT pg_sleep(2) in binary because that function returns void and PG doesn't know how to transfer that. So cast to text server-side.
protected static CreateSleepCommand ( NpgsqlConnection conn, int seconds ) : NpgsqlCommand
conn NpgsqlConnection
seconds int
return NpgsqlCommand
        protected static NpgsqlCommand CreateSleepCommand(NpgsqlConnection conn, int seconds)
        {
            return new NpgsqlCommand(string.Format("SELECT pg_sleep({0}){1}", seconds, conn.PostgreSqlVersion < new Version(9, 1, 0) ? "::TEXT" : ""), conn);
        }