Decrease time needed to CREATE INDEX and FOREIGN KEY on new table column which has all values NULL

2019-01-22 Thread Denisa Cirstescu
Hello all, I am trying to add a new column to a really big table and to define an INDEX and a FOREIGN KEY on that new column using the following instructions: ALTER TABLE Employee ADD COLUMN DepartmentId INTEGER; CREATE INDEX IDX_Employee_DepartmentId ON Employee(DepartmentId); ALTER TABLE Emplo

RE: Regex Replace with 2 conditions

2018-02-05 Thread Denisa Cirstescu
x27;', 'g'); $$ LANGUAGE sql IMMUTABLE; Thanks a lot, Denisa Cîrstescu -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Monday, February 5, 2018 4:43 PM To: Denisa Cirstescu Cc: pgsql-gene...@postgresql.org Subject: Re: Regex Replace with 2 c

Regex Replace with 2 conditions

2018-02-05 Thread Denisa Cirstescu
Hi all, Is there a way to specify 2 conditions in regexp_replace? I need an SQL function that eliminates all ASCII characters from 1-255 that are not A-Z, a-z, 0-9, and special characters % and _ so something like: SELECT regexp_replace(p_string, E'[' || CHR(1) || '-' || CHR(255) || '&&[^A-Za-