![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to prove a bug exists in a piece of code. I believe that the code is reading and displaying information based on database order and not a flag that is set in the database. The table I am looking at has 64 fields. I take it this is a single, physical table, NOT a join of a couple of |
|
Each field has data. What I would like to do is to take 2 rows and reverse the "natural" order. I understand I can delete those rows and then re-insert them, but with the amount of data it seems likely there could be human error. Is there any other way to reorder rows already in the database? Rewriting a record is the only way, however that will happen even if you |
#3
| |||
| |||
|
|
"eldorado" <eldorado (AT) io (DOT) com> schreef in bericht news:20061102130524.D55425 (AT) eris (DOT) io.com... I am trying to prove a bug exists in a piece of code. I believe that the code is reading and displaying information based on database order and not a flag that is set in the database. The table I am looking at has 64 fields. I take it this is a single, physical table, NOT a join of a couple of tables. If the 64 fields are scattered across multiple tables proving your bug require more details. Each field has data. What I would like to do is to take 2 rows and reverse the "natural" order. I understand I can delete those rows and then re-insert them, but with the amount of data it seems likely there could be human error. Is there any other way to reorder rows already in the database? Rewriting a record is the only way, however that will happen even if you change only a single field. Thus, make a selection of just a few records and modify a field -add a character to a varchar field- in the first row. Redo the same selection and if you find the modified row listed last, you've your bug proven. If you use a frontend to view results be aware some may use an index to order unsorted results. Such a frontend will mask the bug you are hunting for. Just a note of history: as of version 7.4 -released 2003-11-17- 'group by' is often NOT doing 'order by' too. http://www.postgresql.org/docs/8.1/s...lease-7-4.html HansH |

![]() |
| Thread Tools | |
| Display Modes | |
| |