Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Postgresql generate UUID

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

SELECT uuid_generate_v4();

           uuid_generate_v4
--------------------------------------
 a81bc81b-dead-4e5d-abff-90865d1e13b1
(1 row)
Code language: SQL (Structured Query Language) (sql)
Comment

postgressql uuid

SELECT gen_random_uuid();
Comment

add uuid_generate_v4() in postgres

select * from pg_extension;
CREATE EXTENSION "uuid-ossp";
Comment

postgres generate uuid

uuid-ossp is a contrib module, so it isn't loaded into the server by default. You must load it into your database to use it.

For modern PostgreSQL versions (9.1 and newer) that's easy:

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
but for 9.0 and below you must instead run the SQL script to load the extension. See the documentation for contrib modules in 8.4.

For Pg 9.1 and newer instead read the current contrib docs and CREATE EXTENSION. These features do not exist in 9.0 or older versions, like your 8.4.

If you're using a packaged version of PostgreSQL you might need to install a separate package containing the contrib modules and extensions. Search your package manager database for 'postgres' and 'contrib'.
Comment

PREVIOUS NEXT
Code Example
Sql :: sql distinct only one column 
Sql :: list all tables in postgres 
Sql :: soql last week 
Sql :: between sql server 
Sql :: c# sqldatareader to list 
Sql :: mysql declare variable 
Sql :: oracle free up space in tablespace 
Sql :: remove foreign key constraints in postgres 
Sql :: how to create external table in hive 
Sql :: sql server to uppercase 
Sql :: sql server last character in string 
Sql :: SQL query to verify the size of the table 
Sql :: select top 3 sql 
Sql :: create scalar function in sql server 
Sql :: postgres 11 add primary key 
Sql :: sql server drop database 
Sql :: c# update sql statement 
Sql :: mysql if 
Sql :: check if value is null mysql 
Sql :: SQL check if record exist 
Sql :: alter table primary key postgresql 
Sql :: restore backup mysql .gz 
Sql :: sql select if two columns are equal 
Sql :: insert array into mysql column 
Sql :: mysql where length greater than 
Sql :: python mysql create table if not exists 
Sql :: delete from inner join sql 
Sql :: insert into table from another table 
Sql :: uncheck constraints and delete from table 
Sql :: how to connect to postgres 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =