라벨이 extension인 게시물 표시

PostgreSQL Extension(확장 모듈) 설치하기 : UUID

이미지
이번 postgres을 사용하다가 해당 쿼리문을 사용할수 없어서 확인하다가 확장 모듈이 필요하다는 것을 알고 기록을 위해 블로그로 작성하였습니다.  테이블을 생성하는 도중 column의 데이터 타입을 uuid_generate_v4()로 설정을 하고 테이블을 생성할려고 할때 아래 사진과 같이 에러가 발생했습니다. 사진1) 에러 상황 위 에러가 발생하면 가장 먼저 해당 extension이 사용 가능하지 확인을 해야 합니다. psql에서 설치 가능한 extension을 확인한다. $ SELECT * FROM pg_available_extensions; copy 사진2) 설치 가능한 extension 사진2에서 가장 마지막에 있는 'uuid-ossp'이 있습니다. 이 확장 모듈이 uuid생성을 도와줍니다. 이제 'uuid-ossp'를 설치해 보도록 하겠습니다. psql에서 extension가 존재하지 않을때 설치. $ CREATE EXTENSION IF NOT EXISTS "extension name"; copy 위 블로그에서는 uuid를 생성할수 있어야 하기 때문에 'uuid-ossp'를 설치하도록 하겠습니다. 해당 sql문은 CREATE EXTENSION IF NOT EXISTS "uuid-ossp" 으로 실행하면 됩니다. 사진3) "uuis-ossp" 설치 사진4) 생성 완료 원하던 쿼리문이 정상적으로 실행 된것을 확인할수 있었습니다.  아래는 실행한 해당 쿼리문 입니다 CREATE TABLE users (   id UUID NOT NULL DEFAULT uuid_generate_v4(),   email VARCHAR NOT NULL,   password VARCHAR NOT NULL,   username VARCHAR NOT NULL,   socialSignUP Boolean NOT NULL DEFAULT false,   soc...

node.js check file, folder path or concatenate path

이미지
 Please read how to initialize npm from this  post. 1. require // Reference : https://nodejs.org/dist/latest-v14.x/docs/api/path.html const path = require ( 'path' ); 2. Base File name console . log ( "The Base File Path" ); console . log ( path . basename ( __filename )); Print the current file name. use '.basename' to console.log the file name. The output type is string. '__filename' is the current file. 3. Directory name console . log ( "The File Directory Path" ); console . log ( path . dirname ( __filename )); Print the current file directory. use '.dirname' to console.log the file directory. The output type is string. 4. File Extension console . log ( " The File Extension" ); console . log ( path . extname ( __filename )); Print the current file extension. use '.extname' to console.log the file extension. The output type is string. 5. Create Path Object console . log ( " \n\n The File Whole Info" );...