Re: Reordering a table

From: Howard Cole <howardnews(at)selestial(dot)com>
To: Vibhor Kumar <vibhor(dot)kumar(at)enterprisedb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Reordering a table
Date: 2011-02-22 18:16:06
Message-ID: 4D63FD66.1060907@selestial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 22/02/2011 5:18 PM, Vibhor Kumar wrote:
> If you are using PG 8.4 then you can try something with row_number as
> given below:
> select id,stamp, row_number() over(order by stamp) from test;
>
> Or
>
> Create table test1 as select row_number() over(order by stamp) as id, stamp from test;
>
> Thanks& Regards,
> Vibhor Kumar
>
I have not come across that that function before. I'll take a closer look.

Many thanks to all for the quick responses.

Howard.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ralph Smith 2011-02-22 19:04:59 EXECUTE of a 'create table' string is not happening
Previous Message Scott Ribe 2011-02-22 18:03:42 Re: Notify rule