Re: kinda newbie - ish question

From: Doug McNaught <doug(at)wireboard(dot)com>
To: mmacie(at)earthlink(dot)net (Mike Judkins)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: kinda newbie - ish question
Date: 2001-10-10 20:03:53
Message-ID: m3lmij5kk6.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mmacie(at)earthlink(dot)net (Mike Judkins) writes:

> to get my auto increment unique key to automatically populate as
> usual. Then I want to be able to insert another value in this same row
> which is a URL. This URL is basically a path plus a filename which I
> want to have the exact same name as the unique key that was just
> generated for the row. Is there a quick way is SQL to do this or will
> I have to handle it in my script?

Why not leave the unique ID part out of the stored URL and then
combine them when you fetch from the DB? It would be something like

SELECT urlprefix || id::text FROM mytable WHERE <whatever>

(That's assuming the ID is non-text, like a SERIAL)

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvar Freude 2001-10-10 20:04:03 Re: PG mailing list problems (was Re: Support issues)
Previous Message Lamar Owen 2001-10-10 19:53:37 Re: Postgres --with-python problems..