Обсуждение: uuid on windows

Поиск
Список
Период
Сортировка

uuid on windows

От
"Sabin Coanda"
Дата:
Hi there,

I installed Postgres "PostgreSQL 8.3.5, compiled by Visual C++ build 1400" 
on Windows OS, and I tried to check some uuid functions, for instance:       SELECT uuid_generate_v1();

But I found the following error message:   ERROR:  function uuid_generate_v1() does not exist   LINE 1: SELECT
uuid_generate_v1()                 ^   HINT:  No function matches the given name and argument types. You might 
 
need to add explicit type casts.

Why ? What I should install more to have uuid functions ?

TIA,
Sabin




Re: uuid on windows

От
Richard Huxton
Дата:
Sabin Coanda wrote:
> Hi there,
> 
> I installed Postgres "PostgreSQL 8.3.5, compiled by Visual C++ build 1400" 
> on Windows OS, and I tried to check some uuid functions, for instance:
>         SELECT uuid_generate_v1();
> 
> But I found the following error message:
>     ERROR:  function uuid_generate_v1() does not exist

You'll want the uuid-ossp module:

http://www.postgresql.org/docs/8.3/static/datatype-uuid.html
http://www.postgresql.org/docs/8.3/static/uuid-ossp.html

I *think* it's one of the optional modules with recent installers, but I
don't run Windows routinely, so you'll have to check.

--  Richard Huxton Archonet Ltd


Re: uuid on windows

От
"Sabin Coanda"
Дата:
I run the following script and now it works:

CREATE OR REPLACE FUNCTION uuid_generate_v1()
RETURNS uuid
AS '$libdir/uuid-ossp', 'uuid_generate_v1'
VOLATILE STRICT LANGUAGE C;

Similar for all the other defined uuid functions.

Unfortunatelly I experienced the same problem on linux version 8.3.5. after 
I installed the package. But there the same script doesn't work, and logs 
that the file is not found.

Sabin 




Re: uuid on windows

От
Richard Huxton
Дата:
Sabin Coanda wrote:
> I run the following script and now it works:
> 
> CREATE OR REPLACE FUNCTION uuid_generate_v1()
> RETURNS uuid
> AS '$libdir/uuid-ossp', 'uuid_generate_v1'
> VOLATILE STRICT LANGUAGE C;
> 
> Similar for all the other defined uuid functions.

There should be a uuid-ossp.sql file with all those definitions in. Also
an "uninstall" version of the file too.

> Unfortunatelly I experienced the same problem on linux version 8.3.5. after 
> I installed the package. But there the same script doesn't work, and logs 
> that the file is not found.

The uuid-ossp.so file? Is it in the right directory? Is it readable by
the postgres user?

--  Richard Huxton Archonet Ltd


Re: uuid on windows

От
"Sabin Coanda"
Дата:
>
> I *think* it's one of the optional modules with recent installers, but I
> don't run Windows routinely, so you'll have to check.
>

I installed with full optional modules on Windows, but uuid is still 
missing. However, I found C:\Program 
Files\PostgreSQL\8.3\share\contrib\uuid-ossp.sql, I run it and it's ok now.

Thanx,
Sabin