On Saturday, July 14, 2012, Guillaume Lelarge wrote:
On Thu, 2012-07-12 at 12:31 +0100, Thom Brown wrote:
> On 12 July 2012 12:20, Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de> wrote:
> > Hello,
> >
> > I have a feature request for the 'Edit data' window that is available for each table in pgAdmin.
> >
> > As the OID column is not guaranteed to contain unique OIDs
Oops, sorry? each OID is unique.
No, the counter can wrap.
> it would be nice to have additional/other fallback options ( via check box in pgAdmin's general options? ) to identify rows for editing in tables without primary keys.
> > I'd suggest serials ( serial/serial4 and bigserial/serial8 )
You can't be sure a serial (serial2, serial4, and serial8) column will
only contain unique values.
> or unique columns/constraints.
Yes, this would be interesting to add. I thought we already did it, but
I gues I was wrong. I'll add a ticket to work on this later.
That method will work only if the columns involved are all not null constrained.
> > Another drawback of OID columns is that you can't add them afterwards.
>
You can add OID columns to an already existing table since 8.4. But it
doesn't mean you want to (and actually I don't want to add OID columns
to my tables).
> Use of the CTID system column would work.
I don't see how that could work. CTIDs obviously are unique, but anyone,
updating a line will get another CTID for this line. If you try to
update it afterwards, in the best case, it errors out because there is
no line at this CTID. In the worst case, you update a completely
different line.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support
--
Dave Page
Blog:
http://pgsnake.blogspot.comTwitter: @pgsnake
EnterpriseDB UK:
http://www.enterprisedb.com The Enterprise PostgreSQL Company