Re: Insert UUID GEN 4 Value

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: tango ward <tangoward15(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Insert UUID GEN 4 Value
Date: 2018-05-31 03:51:50
Message-ID: 1527738710.2400.4.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

tango ward wrote:
> I found this:
>
> CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
> SELECT uuid_generate_v4();
>
> My problem is I have a table like this:
> CREATE TABLE enrollmentinfo (
> id integer NOT NULL,
> created timestamp with time zone NOT NULL,
> modified timestamp with time zone NOT NULL,
> secure_id uuid NOT NULL,
> relationship character varying(50) NOT NULL,
> tuition_bill character varying(255) NOT NULL
> );
>
> Now I need to insert data into this table, I just don't know if I can use something like this
> "INSERT INTO enrollmentinfo (current_timestamp, current_timestamp, uuid_generate_v4(), '', '');
> I haven't tried this but also not sure if I can call the function inside INSERT.

Why didn't you try it?

I see no problem with that.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tango ward 2018-05-31 03:53:16 Re: Insert UUID GEN 4 Value
Previous Message tango ward 2018-05-31 03:48:40 Re: Insert UUID GEN 4 Value