| From: | Raymond O'Donnell <rod(at)iol(dot)ie> |
|---|---|
| To: | Willy-Bas Loos <willybas(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: auto-increment in a view |
| Date: | 2009-09-03 16:27:09 |
| Message-ID: | 4A9FEE5D.3030400@iol.ie |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On 03/09/2009 17:22, Willy-Bas Loos wrote:
> Hi,
>
> I'm trying to figure out to generate a auto-increment column in a view.
> There is no physical column to base it on, the view contains a group
> by clause, which renders that impossible.
> In a normal query i can create a sequence for that purpouse and drop
> it afterwards, but apart form it being ugly, it's impossible in a
> view.
Just a wild notion, but would the generate_series function be any use to
you?
http://www.postgresql.org/docs/8.4/static/functions-srf.html
HTH,
Ray.
------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Fetter | 2009-09-03 16:28:07 | Re: [Q] optmizing postgres for 'single client' / many small queries |
| Previous Message | Willy-Bas Loos | 2009-09-03 16:22:01 | auto-increment in a view |