Re: One time only trigger/function on every row...

From: "Andrew G(dot) Hammond" <drew(at)xyzzy(dot)dhs(dot)org>
To: wyatt(at)draggoo(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: One time only trigger/function on every row...
Date: 2001-11-19 18:49:41
Message-ID: E165tUL-0000Qn-00@xyzzy.lan.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2001 November 17 03:55 pm, wyatt(at)draggoo(dot)com wrote:
> I didn't even think of this as I was adding books into my database, but I
> didn't rearrange the titles ('Shining, The' as opposed to 'The Shining')
> like I should have.
>
> I'm writing a function to use as a trigger to check and, if need be,
> rearrange the titles as they are added to the database, but is there an
> easy way to loop through all of the records currently in the database and
> run that function on them?

Perhaps
SELECT fix_title(*) FROM books WHERE title LIKE 'The %';

- --
Andrew G. Hammond mailto:drew(at)xyzzy(dot)dhs(dot)org http://xyzzy.dhs.org/~drew/
56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F 613-389-5481
5CD3 62B0 254B DEB1 86E0 8959 093E F70A B457 84B1
"To blow recursion you must first blow recur" -- me
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjv5VEoACgkQCT73CrRXhLH1MACghw4ENekgfdI5mhdiriyEOHi8
RdkAni6t1FbS1NM4DxwNy7YdvB5Xs1sp
=F/2e
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-11-19 19:09:14 Re: revoke all from public ?
Previous Message Greg Sabino Mullane 2001-11-19 18:47:51 Version checking when loading psql