Getting error while running update query in postgresql
NickName:Moolya Ask DateTime:2021-06-30T13:00:50

Getting error while running update query in postgresql

I am new to PostgreSQL. While running below update query I am getting below error.

update useremails ue 
SET ue.useinstitutionid=id.InstitutionID from instdomains id 
where ue.email REGEXP CONCAT('^.*[.@]',id.DomainMask,'$');

ERROR: syntax error at or near "REGEXP"

Mysql query

UPDATE useremails
JOIN instdomains ON useremails.email 
REGEXP CONCAT('^.*[.@]',instdomains.DomainMask,'$')
SET useremails.useinstitutionid=instdomains.InstitutionID;

I converted this query from mysql to Postgresql. How can rewrite this query in postgresql?

Copyright Notice:Content Author:「Moolya」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/68188686/getting-error-while-running-update-query-in-postgresql

More about “Getting error while running update query in postgresql” related questions

Getting error while running update query in postgresql

I am new to PostgreSQL. While running below update query I am getting below error. update useremails ue SET ue.useinstitutionid=id.InstitutionID from instdomains id where ue.email REGEXP CONCAT('...

Show Detail

while running the update query in foxpro getting this error

while runing the following code for update : $conn = new COM("ADODB.Connection"); $conn->Open('Provider=VFPOLEDB.1; Data Source="C:\Users\TEMP.HIDEAZSERVER\Desktop\databaseetc\testdata";'); &#

Show Detail

Getting a Syntax error after running PostgreSQL query

Can someone please help where is the syntax error in below query when ever I am using the below query I am getting a syntax error? [query] #su postgres -c 'psql -d ovirt_engine_history -c " UP...

Show Detail

POSTGRESQL - trying to update DB while query is running

I'm trying to update my database with a value while another query is running. I tried using pg_sleep but it ignores any updates to the DB, heres my query : myfunc(){ return db.many(`SELECT *...

Show Detail

Getting ERROR while running ALTER statement inside the SQL function

I wrote a SQL function to ALTER the SCHEMA Ownership. I am able to run the statement directly(without function) but getting error while running the ALTER statement within the function. Function "

Show Detail

unexpected token error while running PostgreSQL query in Java

I have created the following query for PostgreSQL which is working fine in SqlWorkbench. But when I integrated this in Java code, I'm getting a syntax error exception: Query running fine in SqlWor...

Show Detail

How to see update status for long running update queries in postgresql?

My questions for postgresql, suppose i have 10 million records in a table and want to update a column for the all rows and running this query takes quite time, while this query is running i want to...

Show Detail

Getting info about running update query

On Sql Server 2008, I have a slow-running update query that has been working for 3 hours. Is there any way to get any statistics (say, how many rows have changed so far or something else) about this

Show Detail

Why PostgreSQL throws concurrent update error while SELECT FOR UPDATE SKIP LOCKED?

My Java application interacts with PostgreSQL via MyBatis. From multiple threads it executes this request select * from v_packet_unread limit 1000 for update skip locked and sometimes gets

Show Detail

Getting an error while running Liquibase update: Privilege issue

I am getting this error while running Liquibase Update. Unexpected error running Liquibase: Error executing SQL SELECT MAX(ORDEREXECUTED) FROM G123.DATABASECHANGELOG: DB2 SQL Error: SQLCODE=-551,

Show Detail