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 :: see all databases mysql 
Sql :: set default today mysql 
Sql :: ci last query 
Sql :: too many connections mysql 
Sql :: alembic.util.exc.CommandError: Target database is not up to date. 
Sql :: sql server beginning of month 
Sql :: sql not start with vowel 
Sql :: how to get all tables in sql 
Sql :: postgres remove database 
Sql :: show list of users in mysql 
Sql :: set mysql mode global query 
Sql :: mysql copy table with new name 
Sql :: ubuntu stop mysql 
Sql :: alter foreign key 
Sql :: oracle sql drop index 
Sql :: mysql select last 15 minutes 
Sql :: mysql get last day of month 
Sql :: create table sql server 
Sql :: postgresql search all tables for column name 
Sql :: postgresql convert text to float 
Sql :: install mysql server linux 
Sql :: how to get current date in mysql 
Sql :: connect python to mysql 
Sql :: how to add auto increment primary key 
Sql :: mysql show column data types 
Sql :: mysql strict_trans_tables 
Sql :: mysql return text after a final full stop 
Sql :: vagrant mysql downgrade version 
Sql :: how to select department from table 
Sql :: edate dax 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =