[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 
npgsql generates invalid SELECT statement.

Any idea how to fix this ?


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");
 IDbCommand cmd = new Npgsql.NpgsqlCommand(
   "select * from pg_tables limit 1", conn);


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