On Wed, Sep 07, 2005 at 12:06:10PM -0700, [EMAIL PROTECTED] wrote:
> According to the documentation at:
> http://www.postgresql.org/docs/8.0/static/ecpg-connect.html
> 
>    EXEC SQL CONNECT TO :target USER :user;
>    The last form makes use of the variant referred to above as character
>    variable reference.

The complete text is:

  The last form makes use of the variant referred to above as
  character variable reference.  You will see in later sections how
  C variables can be used in SQL statements when you prefix them
  with a colon.

Note "C variables" -- it's talking about the C character type, not
the SQL character type.

> To be consistent with other uses of host variables,
> we request that host variables within a connect statement
> act like host variables in DML statements.

They *do* act the same way: the value is passed to the server, which
handles it according to the appropriate type's semantics.  If the
host variable's value is used in a CHAR context then trailing spaces
aren't significant in comparisons; if the value is used in other
contexts like VARCHAR, TEXT, or NAME, then trailing spaces *are*
significant.  The server makes the decision, not the ECPG preprocessor
or library, which simply passes the value to the server.

If you think this behavior should be changed then propose it on
pgsql-hackers and discuss it with the developers.

-- 
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to