Randomly sort all non-ordered rows Is there a way to get PostgreSQL to randomly order query results that haven't been ordered by an ORDER BY? I think this would be a useful way to seek out bugs caused by an implicit reliance on the order of DB results.
Well, if there is no ORDER BY clause, the results is a non-ordered set, so the order that the rows are returned should be considered 'random' anyway.
However, PostgreSQL will typically fetch the rows in the most efficient manner, which may be the order they were inserted.
You can 'work around' this by performing a mock update, which will move the updated rows to the 'end' of the line. You can repeat several dissimilar updates using modulo, random or any other form that will filter a 'seemingly random' subset.
Something along the lines of:

DROP TABLE IF EXISTS Foo;

CREATE TABLE Foo (Col1 INT PRIMARY KEY);

INSERT INTO Foo (Col1)
SELECT * FROM generate_series(1, 20);

SELECT * FROM Foo;

UPDATE  Foo
SET     Col1 = Col1
WHERE   Col1%3 = 0;

UPDATE  Foo
SET     Col1 = Col1
WHERE   Col1%5 = 0;

SELECT * FROM Foo;


Do this in development environment only, not in production of course :-)

HTH