pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: tango ward <tangoward15@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Insert UUID GEN 4 Value
Date: Thu, 31 May 2018 05:51:50 +0200
Message-ID: <1527738710.2400.4.camel@cybertec.at> (raw)
In-Reply-To: <CAA6wQLJr6fjzx+ZK6N4yiViZYdFuGGkMT27zsp-mR1SjAzbGEg@mail.gmail.com>
References: <CAA6wQLK1MLj6gL9wQYLNZD541_xJjbv9X5EzVADOtMhQnifc9w@mail.gmail.com>
	<1527738102.2400.1.camel@cybertec.at>
	<CAA6wQLJr6fjzx+ZK6N4yiViZYdFuGGkMT27zsp-mR1SjAzbGEg@mail.gmail.com>

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




view thread (21+ messages)  latest in thread

Message-ID: <1527738710.2400.4.camel@cybertec.at>
Permalink:  ../1527738710.2400.4.camel@cybertec.at/
Also on:    postgresql.org/message-id/1527738710.2400.4.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, tangoward15@gmail.com
  Subject: Re: Insert UUID GEN 4 Value
  In-Reply-To: <1527738710.2400.4.camel@cybertec.at>
  References: <CAA6wQLK1MLj6gL9wQYLNZD541_xJjbv9X5EzVADOtMhQnifc9w@mail.gmail.com> <1527738102.2400.1.camel@cybertec.at> <CAA6wQLJr6fjzx+ZK6N4yiViZYdFuGGkMT27zsp-mR1SjAzbGEg@mail.gmail.com> <1527738710.2400.4.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox