Re: DB migration : Sybase to Postgres

2023-05-25 Thread Ron
I don't remember, to be honest.  ALTER TABLE ... VALIDATE CONSTRAINT was /really fast/, though. Having a supporting index (which Pg does /not/ automatically create) is vital, of course. On 5/25/23 23:16, Sengottaiyan T wrote: Thanks Ron. While enabling the constraint (valid constraint) afte

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Sengottaiyan T
Thanks Ron. While enabling the constraint (valid constraint) after initial data import, will it scan all the table data or the validation will happen for new rows inserted after that point)? On Thu, May 25, 2023 at 6:40 PM Ron wrote: > If I read your email correctly, I see two options > - Apply

PostgreSQL GSSAPI Windows AD

2023-05-25 Thread Jean-Philippe Chenel
Hi, I've recently updated from PostgreSQL 9.6 to 14 and also ubuntu 16.04 to 22.04. I've made all the installation required for postgresql to connect in GSSAPI authentication to a Windows domain. Something is going wrong and I don't know why. When I change the mapped user password from "postgres

Re: Having issue with SSL.

2023-05-25 Thread Randy Needham
Some new information. I was able to connect to postgresql via ssl from a machine in the same subnet as the server. Beyond port 5432 is there any other ports that need to be opened to access postgresql via ssl? There is a firewall setup between the server and the clients that need access but w

Re: CREATE TEMPORARY TABLE LIKE

2023-05-25 Thread Erik Wienhold
> On 25/05/2023 15:06 CEST Jim Vanns wrote: > > When basing a temporary table of a source table, are triggers included > by default? I have this statement; > > CREATE TEMPORARY TABLE dev_main ( > LIKE prod_main > INCLUDING ALL > EXCLUDING INDEXES > EXCLUDING CONSTRAINTS > ) ON COMMIT DELETE ROWS;

Re: CREATE TEMPORARY TABLE LIKE

2023-05-25 Thread Jim Vanns
I just wrote a little test case... it appears not. Triggers aren't fired in the temporary table. Jim On Thu, 25 May 2023 at 14:06, Jim Vanns wrote: > > Hi everyone, > > When basing a temporary table of a source table, are triggers included > by default? I have this statement; > > CREATE TEMPORAR

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Ron
If I read your email correctly, I see two options - Apply FK constraints *after* initial data load. - Load parent data before child data (You can create the FKs ahead of time, but use the NOT VALID clause; then, after data is loaded do ALTER TABLE ... VALIDATE CONSTRAINT.) On 5/25/23 06:30, Se

CREATE TEMPORARY TABLE LIKE

2023-05-25 Thread Jim Vanns
Hi everyone, When basing a temporary table of a source table, are triggers included by default? I have this statement; CREATE TEMPORARY TABLE dev_main ( LIKE prod_main INCLUDING ALL EXCLUDING INDEXES EXCLUDING CONSTRAINTS ) ON COMMIT DELETE ROWS; And wondering if there is a trigger (row-based af

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Erik Wienhold
> On 25/05/2023 12:08 CEST Laura Smith > wrote: > > > Looks like an encoding issue and a mismatch between database encoding and > > client encoding. You can check both with: > > > > SHOW server_encoding; > > SHOW client_encoding; > > > > Then either set the client encoding or use COPY's encoding

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Erik Wienhold
> On 25/05/2023 13:26 CEST Peter J. Holzer wrote: > > On 2023-05-25 07:14:40 +, Laura Smith wrote: > > I'm currently doing a CSV export using COPY: > > > > COPY (select * from foo where bar='foo') TO '/tmp/bar.csv' DELIMITER ',' > > CSV HEADER; > > > > This works great apart from accents are

Re: Question regarding specifics of GIN and pg_trgm performance and potential use of show_trgm to improve it

2023-05-25 Thread Tomas Vondra
On 5/24/23 22:28, Pavel Horal wrote: > Hello PostgreSQL community, > > I am trying to improve performance of using similarity based queries on > a large datasets and I would like to confirm my understanding of how GIN > indexes work and how pg_trgm uses them. > > If I understand it correctly, usi

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Sengottaiyan T
Is there an option to set novalidate constraints in postgres? In my source Sybase DB, table structures are not defined properly (only primary keys exist and no foreign key) - I'm making necessary changes on target Postgres DB (created tables, identifying relationship between table columns with resp

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Peter J. Holzer
On 2023-05-25 07:14:40 +, Laura Smith wrote: > I'm currently doing a CSV export using COPY: > > COPY (select * from foo where bar='foo') TO '/tmp/bar.csv' DELIMITER ',' CSV > HEADER; > > > This works great apart from accents are not preserved in the output, > for example é gets converted to

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Laura Smith
> Looks like an encoding issue and a mismatch between database encoding and > client > encoding. You can check both with: > > SHOW server_encoding; > SHOW client_encoding; > > Then either set the client encoding or use COPY's encoding option to match the > database encoding (I assume utf8 in t

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Erik Wienhold
> On 25/05/2023 09:14 CEST Laura Smith > wrote: > > I'm currently doing a CSV export using COPY: > > COPY (select * from foo where bar='foo') TO '/tmp/bar.csv' DELIMITER ',' CSV > HEADER; > > This works great apart from accents are not preserved in the output, for > example é gets converted to r

Maintaining accents with "COPY" ?

2023-05-25 Thread Laura Smith
Hi I'm currently doing a CSV export using COPY: COPY (select * from foo where bar='foo') TO '/tmp/bar.csv' DELIMITER ',' CSV HEADER; This works great apart from accents are not preserved in the output, for example é gets converted to random characters, e.g. √© or similar. How can I preserve