Re: Insert UUID GEN 4 Value

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Insert UUID GEN 4 Value
Date: 2018-06-01 01:10:42
Message-ID: 6d19c679-3116-2ceb-513e-77728504b37e@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/31/2018 07:39 PM, tango ward wrote:
> On Thu, May 31, 2018 at 12:32 PM, tango ward <tangoward15(at)gmail(dot)com
> <mailto:tangoward15(at)gmail(dot)com>> wrote:
>
>
> On Thu, May 31, 2018 at 12:18 PM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com <mailto:david(dot)g(dot)johnston(at)gmail(dot)com>> wrote:
>
> On Wednesday, May 30, 2018, tango ward <tangoward15(at)gmail(dot)com
> <mailto:tangoward15(at)gmail(dot)com>> wrote:
>
> Okay I will try it.
>
>
> When I tried it, I am getting an error: Invalid input syntax
> for UUID: uuid_generate_v4(),
>
>
> Avoid references to "it" and just show the code you tried to run.
>
> David J.
>
>
>
> I'm testing this code:
>
> curr_pgsql.execute('''CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; ''')
> curr_pgsql.execute('''
>                     INSERT INTO enrollmentinfo (
> created, modified,
> secure_id,
> relationship,
> tuition_bill,
> cashier_name,
> cashier_phone_number
> )
>                     VALUES (current_timestamp, current_timestamp,
>                             uuid_generate_v4(), '', '', '',)
> ''')
>
>
> curr_pgsql.execute('''CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; ''')
> curr_pgsql.execute('''
>                     INSERT INTO enrollmentinfo (
> created, modified,
> secure_id,
> relationship,
> tuition_bill,
> cashier_name,
> cashier_phone_number
> )
>                     VALUES (current_timestamp, current_timestamp,
>                             uuid_generate_v4(), '', '', '',)
> ''')
>
>
> Hi, this is the query that I am trying to run. I'll try your suggestions
> when I arrived in the office.

Honestly, I'd try it in psql first.  That will eliminate all possible
problems due to quoting errors, etc.

--
Angular momentum makes the world go 'round.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nicolas Seinlet 2018-06-01 09:36:54 Re: Sort is generating rows
Previous Message tango ward 2018-06-01 00:39:25 Re: Insert UUID GEN 4 Value