Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOErP-0004uD-Jk for pgsql-general@arkaria.postgresql.org; Thu, 31 May 2018 04:06:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fOErN-0007WD-H6 for pgsql-general@arkaria.postgresql.org; Thu, 31 May 2018 04:06:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOErN-0007W4-6f for pgsql-general@lists.postgresql.org; Thu, 31 May 2018 04:06:45 +0000 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fOErJ-0002ML-Nk for pgsql-general@lists.postgresql.org; Thu, 31 May 2018 04:06:44 +0000 Received: by mail-it0-x236.google.com with SMTP id 144-v6so25934864iti.5 for ; Wed, 30 May 2018 21:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oi253f8hd+xJhCWc1xduCpwNxBghBPu19y5RDxgGwgs=; b=IafxkzrOEbWJPqwJ7dU1vMnaci4waWv2cYooJcd4i6UkrJFcank8G0oUlDusQHE0RQ ucPq57rWV08wKdZGXTuFAwaqkQ0HkGqaanaR3jZA8yGuN0AS0x4pdTrVdJD3vjEBpSGv YkCGqJbUNjmoXQsYZ5t25w4uxRQQJgRn4fbvXjqJEJfb6xjIBJJl+aHqghipr0hEycTf NVUQHV7wgn8evrI2CWQK89K3aU+3wy7iOJx7YkBmm82iu2Q2LAUWIHN22N4jvsir30N/ vBhOw5b2tYc9TuID4K0hJ1YyZa49raVTGcw+rzLk0YdzdYdvZxb9nEbmVEXOYFw5s/Jb 7a8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oi253f8hd+xJhCWc1xduCpwNxBghBPu19y5RDxgGwgs=; b=L/SRCI7nx6leczme8RYhSBomDKKiZtGrEP+q9kn4xqPABdlIcQxiDvdG4h38uVBmBL VnSAL0I3oH3dRV2A6p/miOmxPAwtRgscxZGuktzCdyuIXoGBdr/xQA71LtO4mtj7m3lt xGgrGPkfYwxYCKPogk4MKWCp08fKUFUwm19HWCC5/PsovOHKzwE47vZR7hRuFrzk+7Zn PbNFrL3sZuB8kynUh2hOYHykk02OeV3kIIC98Cwv5OyrHHy4n3vL/WXER35z583pbHgf LA1j0ZSInmFiRqWfy7LQ8E51qERyK9faOvVZ+y9satS+Y8hvnw/PR6roYCnJjQlmaF1y S9Lg== X-Gm-Message-State: APt69E1UXYiUqLZ8IV1yqjp2Hcg1hlg8Hb9tCd/YiW5wZD/H33Ozpqow C0gtpvAiFste2+xgqoiqaBy/4iWw X-Google-Smtp-Source: ADUXVKJZUl/ywu+jnWMuyJ6DjcNO4ww5hJsSnWzk5VePxS9f8ZFlSUTb3ErYv8VWAmrqMoI4vlUODg== X-Received: by 2002:a24:51d5:: with SMTP id s204-v6mr4215303ita.151.1527739599733; Wed, 30 May 2018 21:06:39 -0700 (PDT) Received: from ?IPv6:2601:681:5500:1e3c:44fc:cb34:ec04:5735? ([2601:681:5500:1e3c:44fc:cb34:ec04:5735]) by smtp.gmail.com with ESMTPSA id l16-v6sm67158iti.40.2018.05.30.21.06.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 21:06:39 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-83982B0D-3EF9-464F-9911-C3BABDD1F35A Mime-Version: 1.0 (1.0) Subject: Re: Insert UUID GEN 4 Value From: Rob Sargent X-Mailer: iPhone Mail (15E302) In-Reply-To: Date: Wed, 30 May 2018 22:06:38 -0600 Cc: Laurenz Albe , "pgsql-generallists.postgresql.org" Content-Transfer-Encoding: 7bit Message-Id: <74277212-DEDF-4A35-B0BB-25A92088B2A1@gmail.com> References: <1527738102.2400.1.camel@cybertec.at> <1527738710.2400.4.camel@cybertec.at> To: tango ward List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-83982B0D-3EF9-464F-9911-C3BABDD1F35A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > On May 30, 2018, at 9:57 PM, tango ward wrote: >=20 >> On Thu, May 31, 2018 at 11:53 AM, tango ward wrot= e: >>> On Thu, May 31, 2018 at 11:51 AM, Laurenz Albe wrote: >>> tango ward wrote: >>> > I found this:=20 >>> >=20 >>> > CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; >>> > SELECT uuid_generate_v4(); >>> >=20 >>> > 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 >>> > ); >>> >=20 >>> > Now I need to insert data into this table, I just don't know if I can u= se something like this >>> > "INSERT INTO enrollmentinfo (current_timestamp, current_timestamp, uui= d_generate_v4(), '', ''); >>> > I haven't tried this but also not sure if I can call the function insi= de INSERT. >>>=20 >>> Why didn't you try it? >>>=20 >>> I see no problem with that. >>>=20 >>> Yours, >>> Laurenz Albe >>> --=20 >>> Cybertec | https://www.cybertec-postgresql.com >>>=20 >>=20 >>=20 >> Okay I will try it. >=20 > When I tried it, I am getting an error: Invalid input syntax for UUID: uui= d_generate_v4(), What do you get from Select uuid_generate_v4();= --Apple-Mail-83982B0D-3EF9-464F-9911-C3BABDD1F35A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On May 3= 0, 2018, at 9:57 PM, tango ward <tangoward15@gmail.com> wrote:

On Thu, May 31, 2018 at 11:53 AM, tango ward <tan= goward15@gmail.com> wrote:
On Thu, May 3= 1, 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 u= se 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 insid= e 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 in= put syntax for UUID: uuid_generate_v4(),
What do you get from
Select uuid_generate_v4();
= = --Apple-Mail-83982B0D-3EF9-464F-9911-C3BABDD1F35A--