Package: postgresql-8.4
Version: 8.4.4-1~bpo50+1
Severity: wishlist

In rewriting a large database table, we wanted to make a single pass
over the table, changing a "targeturi" column to reference another
table's primary key instead.  We initially tried this:

alter table links alter column targeturi type integer using (select pageid from 
pages where uri = targeturi);

However, this produced "ERROR: cannot use subquery in transform
expression".

The postgresql documentation does not seem to specify the syntax of
"using" very clearly (it just says using takes an "expression").  In any
case, "using (select primarykey from othertable where somecolumn =
oldcolumnvalue)" seems like a common use case when altering a column to
reference another table.  Please consider supporting this
syntax/functionality.

Thanks,
Josh Triplett and Jamey Sharp

-- System Information:
Debian Release: 5.0.6
  APT prefers stable
  APT policy: (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.34.1-rscloud (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages postgresql-8.4 depends on:
ii  libc6           2.7-18lenny4             GNU C Library: Shared libraries
ii  libcomerr2      1.41.3-1                 common error description library
ii  libkrb53        1.6.dfsg.4~beta1-5lenny4 MIT Kerberos runtime libraries
ii  libldap-2.4-2   2.4.11-1+lenny2          OpenLDAP libraries
ii  libpam0g        1.0.1-5+lenny1           Pluggable Authentication Modules l
ii  libpq5          8.4.4-1~bpo50+1          PostgreSQL C client library
ii  libssl0.9.8     0.9.8g-15+lenny8         SSL shared libraries
ii  libxml2         2.6.32.dfsg-5+lenny1     GNOME XML library
ii  locales         2.7-18lenny4             GNU C Library: National Language (
ii  postgresql-clie 8.4.4-1~bpo50+1          front-end programs for PostgreSQL 
ii  postgresql-comm 105~bpo50+1              PostgreSQL database-cluster manage
ii  ssl-cert        1.0.23                   simple debconf wrapper for OpenSSL
ii  tzdata          2010j-0lenny1            time zone and daylight-saving time

postgresql-8.4 recommends no packages.

Versions of packages postgresql-8.4 suggests:
pn  oidentd | ident-server        <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to