Package: postgresql-client-8.4
Version: 8.4.13-0squeeze1
Severity: normal

According to http://www.postgresql.org/docs/8.4/static/app-psql.html :

"The value of the variable is copied literally, so it can even contain 
unbalanced quotes or backslash commands."

Quote and backslash handling is inconsistent in psql variable values, here are 
some examples.


Example 1: cannot set a value starting with a single quote:
 metaguide=> \set var a'aa \echo :var
 a'aa                                   -- correct (but see example #3)
 metaguide=> \set var aaa' \echo :var
 aaa'                                   -- correct
 metaguide=> \set var 'aaa \echo :var
 unterminated quoted string             -- should display 'aaa


Example 2: matching quotes dropped if the first one is at the beginning:
 metaguide=> \set var a'aa' \echo :var
 a'aa'                                  -- correct
 metaguide=> \set var 'aa'a \echo :var
 aaa                                    -- should display 'aa'a
 metaguide=> \set var 'aaa' \echo :var
 aaa                                    -- should display 'aaa'


Example 3: cannot set a backslash command in a variable:
 metaguide=> \set var \echo toto
 toto                                   -- should not display anything
 metaguide=> \echo :var
                                        -- should display "\echo toto"
 metaguide=> \set var a\Qaa 
 Commande \Qaa invalide. Essayez \? pour l'aide-mémoire.
                                        -- should accept setting var to a\Qaa


-- System Information:
Debian Release: 6.0.5
  APT prefers proposed-updates
  APT policy: (500, 'proposed-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages postgresql-client-8.4 depends on:
ii  libc6                  2.11.3-4          Embedded GNU C Library: Shared lib
ii  libedit2               2.11-20080614-2   BSD editline and history libraries
ii  libpq5                 8.4.13-0squeeze1  PostgreSQL C client library
ii  libssl0.9.8            0.9.8o-4squeeze13 SSL shared libraries
ii  postgresql-client-comm 130~bpo60+2       manager for multiple PostgreSQL cl
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

postgresql-client-8.4 recommends no packages.

Versions of packages postgresql-client-8.4 suggests:
ii  postgresql-8.4          8.4.13-0squeeze1 object-relational SQL database, ve
ii  postgresql-doc-8.4      8.4.13-0squeeze1 documentation for the PostgreSQL d

-- no debconf information


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to