Search Postgresql Archives

Re: quick question abt pg_dump and restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx> writes:
> Josh Harrison escribió:
>> Fine. I can use order by when I want  to order it in terms of some columns.
>> But What if I want to maintain the same order as in the database1? ie., I
>> want my rows of TableABC in Database2 to be the same order as the rows in
>> TableABC in Database 1 ???

> You can't.

According to the SQL standard, a table is an *unordered* collection of
rows, and the results of any query are produced in an unspecified order
(unless you use ORDER BY).  The ambiguity about row ordering is
intentional and is exploited by most DBMSes including Postgres to
improve implementation efficiency.  If you assume there is such a thing
as a specific ordering within a table, you'll live to regret it
eventually.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux