Re: Insert UUID GEN 4 Value - Mailing list pgsql-general

From tango ward
Subject Re: Insert UUID GEN 4 Value
Date
Msg-id CAA6wQLJ_tpazkwPOuO6yuqaVYaqDK0c1ZPkdp7vQtY0h6xm15Q@mail.gmail.com
Whole thread Raw
In response to Re: Insert UUID GEN 4 Value  (tango ward <tangoward15@gmail.com>)
Responses Re: Insert UUID GEN 4 Value  (Rob Sargent <robjsargent@gmail.com>)
Re: Insert UUID GEN 4 Value  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Thu, May 31, 2018 at 11:53 AM, tango ward <tangoward15@gmail.com> wrote:
On Thu, May 31, 2018 at 11:51 AM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
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



Okay I will try it.

When I tried it, I am getting an error: Invalid input syntax for UUID: uuid_generate_v4(),

pgsql-general by date:

Previous
From: tango ward
Date:
Subject: Re: Insert UUID GEN 4 Value
Next
From: Rob Sargent
Date:
Subject: Re: Insert UUID GEN 4 Value