Re: Getting The Last Entry - Mailing list pgsql-novice

From Francisco Leovey
Subject Re: Getting The Last Entry
Date
Msg-id 944030.64009.qm@web51703.mail.re2.yahoo.com
Whole thread Raw
In response to Re: Getting The Last Entry  (Luiz Eduardo Cantanhede Neri <lecneri@gmail.com>)
List pgsql-novice
It may be poor design to use OID, but have you ever tried to use a SERIAL field instead?
That alternative is a really poor choice, many headaches when you try to move data to other tables or recover a backup. There is a temptation to use the value in the SERIAL field but it is totaly useless in most cases. Duplicate values, etc.
 
 
 
 
--- On Fri, 9/10/10, Luiz Eduardo Cantanhede Neri <lecneri@gmail.com> wrote:

From: Luiz Eduardo Cantanhede Neri <lecneri@gmail.com>
Subject: Re: [NOVICE] Getting The Last Entry
To: "postgresql novice" <pgsql-novice@postgresql.org>
Date: Friday, September 10, 2010, 12:49 PM

Once I suggested to use oid, but some guys here said was a poor design.

On Fri, Sep 10, 2010 at 12:33 PM, Thom Brown <thom@linux.com> wrote:
On 10 September 2010 16:31, Francisco Leovey <fleovey@yahoo.com> wrote:
>
> if by "last" you mean the last row inserted, use
>
> select *,oid from table order by oid DESC limit 1
>
> (asuming you use OID's)

(copying in list with your response)

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice


pgsql-novice by date:

Previous
From: Luiz Eduardo Cantanhede Neri
Date:
Subject: Re: Getting The Last Entry
Next
From: "J. Roeleveld"
Date:
Subject: Re: PostgreSQL article online - PDF