Can I getting a unique ID from a select

From: "Timasmith" <timasmith(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Can I getting a unique ID from a select
Date: 2007-03-01 14:16:02
Message-ID: 1172758562.246401.3010@j27g2000cwj.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using hibernate, using a view like a read only table and I need a
primary key each time a select is issued.

So in Oracle terms this might work, though I am skeptical that
Hibernate is going to return a cached result.

create view myview as
select rownum, t1.field, t2.field
from tableOne t1, tableTwo t2
where t1.key = t2.fkey

select * from myview

But what I really need is

select makemeauniquekey, t1.field, t2.field
...

Maybe there is no way I think... incrementing a sequence per select
is untenable.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hannes Dorbath 2007-03-01 14:59:11 TSearch2: Can't build gendict output
Previous Message Peter Eisentraut 2007-03-01 14:09:27 Re: cast bytea to text