Update Current Row Based on Prior Row - Mailing list pgsql-novice

From Philip Brooks
Subject Update Current Row Based on Prior Row
Date
Msg-id 1338655423.91460.YahooMailNeo@web121403.mail.ne1.yahoo.com
Whole thread Raw
Responses Re: Update Current Row Based on Prior Row
Re: Update Current Row Based on Prior Row
List pgsql-novice
I had what I thought was a simple update query.. and it has stumped me.
I have a table ordered by a SERIAL named ROWID.
In that table I have a column named TITLE.
Where TITLE is null, I want to set it equal to the previous row's TITLE.

In SQLite, I did it with this:

UPDATE bf
SET title = (
  SELECT title
  FROM bf AS prev
  WHERE title IS NOT NULL AND prev.rowid < bf.rowid
  ORDER BY prev.rowid DESC
  LIMIT 1
)
WHERE title IS NULL

The update is not porting to Postgresql.

Ideas?

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: database in different location owned by different user
Next
From: Tom Lane
Date:
Subject: Re: Update Current Row Based on Prior Row