Generating unique values for TEXT columns

Поиск
Список
Период
Сортировка
От Frank D. Engel, Jr.
Тема Generating unique values for TEXT columns
Дата
Msg-id 072C9A7C-5DA8-11D9-B15C-0050E410655F@fjrhome.net
обсуждение исходный текст
Ответы Re: Generating unique values for TEXT columns  (Josué Maldonado <josue@lamundial.hn>)
Re: Generating unique values for TEXT columns  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: Generating unique values for TEXT columns  (Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is there any "convenient" way to generate (on request) a unique value
for a TEXT column?  I have a situation in which I want users of my
front-end program to be able to manually enter values for this column,
but if they leave it blank (in the front-end), to have the database
automatically fill in a unique value.  I would like to restrict the
unique values to (for example) digits and uppercase letters (this is
flexible, but the uniqueness of the values should be visually
discernible, and all characters should be printable).

I know how to do this with a numeric column (I can just SELECT MAX on
the column and add one, for example), but how can this be done with a
TEXT column?

Thank you!

- -----------------------------------------------------------
Frank D. Engel, Jr.  <fde101@fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB2XiY7aqtWrR9cZoRAqATAJ46xJ3bwsZVpIda0iMSSdcm3/8YKACePSC3
2JAngWmFOlkzC5fNE6HKYMU=
=pblY
-----END PGP SIGNATURE-----



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Merging Data from Multiple DB
Следующее
От: "Joost Kraaijeveld"
Дата:
Сообщение: Re: Generating unique values for TEXT columns