[Mono-list] npgsql ExecuteReader(CommandBehavior.SchemaOnly) not works with LIMIT

Andrus kobruleht2 at hot.ee
Sun Jan 28 16:40:55 EST 2007


FYIReporting RDLDesigner executes select commands containing limit clauses 
using ExecuteReader(CommandBehavior.SchemaOnly)

This causes npgsql ExecuteReader to add LIMIT 0 clause to statement sent to 
PostgreSQL.
npgsql generates invalid SELECT statement.

Any idea how to fix this ?

Andrus.


Code to reproduce:

using System.Data;
using Npgsql;

class Program {
static void Main() {
 Npgsql.NpgsqlConnection conn = new NpgsqlConnection(
  "ENCODING=UNICODE;SERVER=localhost;DATABASE=postgres;" +
  "USER ID=postgres");
 conn.Open();
 IDbCommand cmd = new Npgsql.NpgsqlCommand(
   "select * from pg_tables limit 1", conn);
 cmd.ExecuteReader(CommandBehavior.SchemaOnly);
 }
}

Observed:

Message="ERROR: 42601: syntax error at or near \"limit\""
ErrorSql="select * from pg_tables limit 1 limit 0;" 



More information about the Mono-list mailing list