Re: Transition Tables doesn´t have OID

2018-12-01 Thread Thomas Munro
On Sun, Dec 2, 2018 at 7:38 AM Adrian Klaver wrote: > > On 12/1/18 8:51 AM, PegoraroF10 wrote: > > ok > > then, help me to find alternatives to it. > > As I sad, sometimes whe change our PK, so using OID would be a smart way to > > have a join between old and new transition tables and we would

Re: Transition Tables doesn´t have OID

2018-12-01 Thread Adrian Klaver
On 12/1/18 8:51 AM, PegoraroF10 wrote: ok then, help me to find alternatives to it. As I sad, sometimes whe change our PK, so using OID would be a smart way to have a join between old and new transition tables and we would like to use transition tables because each statement is a lot faster than

Re: Transition Tables doesn´t have OID

2018-12-01 Thread Achilleas Mantzios
On 1/12/18 6:51 μ.μ., PegoraroF10 wrote: ok then, help me to find alternatives to it. As I sad, sometimes whe change our PK, so using OID would be a smart way to have a join between old and new transition tables and we would like to use transition tables because each statement is a lot faster

Re: Transition Tables doesn´t have OID

2018-12-01 Thread PegoraroF10
ok then, help me to find alternatives to it. As I sad, sometimes whe change our PK, so using OID would be a smart way to have a join between old and new transition tables and we would like to use transition tables because each statement is a lot faster than each row for auditing purposes. So,

Re: Process for populating tables in new database

2018-12-01 Thread Rich Shepard
On Sat, 1 Dec 2018, Adrian Klaver wrote: Forgot to add that if you pre-assign the keys to the serial field you will need to advance the sequence to a value past the last key value to avoid a duplicate key error when you let the sequence assign numbers. Adrian, Got it, thanks. Carpe

Re: Process for populating tables in new database [RESOLVED]

2018-12-01 Thread Rich Shepard
On Sat, 1 Dec 2018, Adrian Klaver wrote: If you don't supply the key it will be generated as the default for the PK column is a sequence. Thanks, Adrian. I thought this to be the case and did not find confirmation in the manual (perhaps I just missed seeing it.) So are the tables you are

Re: Process for populating tables in new database

2018-12-01 Thread Adrian Klaver
On 12/1/18 6:09 AM, Rich Shepard wrote: I have a new database with five tables, and text files with data to populate the tables using the insert command. 1. Each table has a sequential primary key. Should I manually add keys to each insert row or will postgres generate it automatically?

Re: Transition Tables doesn´t have OID

2018-12-01 Thread Andrew Gierth
> "PegoraroF10" == PegoraroF10 writes: PegoraroF10> I would like to user OID value because we change our PegoraroF10> primary keys, sometimes, OID doesn´t. "oid" as a special system column and the WITH OIDS option when creating tables are being removed in pg12 (having been deprecated for

Process for populating tables in new database

2018-12-01 Thread Rich Shepard
I have a new database with five tables, and text files with data to populate the tables using the insert command. 1. Each table has a sequential primary key. Should I manually add keys to each insert row or will postgres generate it automatically? Example, for the companies table: org_id|

Re: Transition Tables doesn´t have OID

2018-12-01 Thread Adrian Klaver
On 12/1/18 4:22 AM, PegoraroF10 wrote: I´m trying to use transition tables for auditing purposes. create trigger MyTableAudit_UPD after update on MyTable referencing old table as Transition_old new table as Transition_new for each statement execute procedure AuditTable(); create or replace

Re: Transition Tables doesn´t have OID

2018-12-01 Thread PegoraroF10
yes, mytable has OID column select oid, ID, Name from MyTable limit 3 oid id name 279515 1104Carol 279516 1106Dalva 279517 11008354Melissa -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Re: Unused indexes

2018-12-01 Thread Martín Marqués
El sáb., 1 dic. 2018 a las 8:24, Ron () escribió: > > For indexes that existed before the cluster was last started, and for which > REINDEX hasn't been run on them since the cluster was last started... is it > valid to say that an index has not been used since the cluster was started > if these

Re: Unused indexes

2018-12-01 Thread Rene Romero Benavides
I think your assumption is correct, as long as the statistics collector is working correctly (I've never seen this not being the case), and the setting "track_counts" is set to on. Am Sa., 1. Dez. 2018 um 05:24 Uhr schrieb Ron : > For indexes that existed before the cluster was last started, and

Re: Transition Tables doesn´t have OID

2018-12-01 Thread Ron
On 12/01/2018 06:22 AM, PegoraroF10 wrote: I´m trying to use transition tables for auditing purposes. create trigger MyTableAudit_UPD after update on MyTable referencing old table as Transition_old new table as Transition_new for each statement execute procedure AuditTable(); create or replace

Transition Tables doesn´t have OID

2018-12-01 Thread PegoraroF10
I´m trying to use transition tables for auditing purposes. create trigger MyTableAudit_UPD after update on MyTable referencing old table as Transition_old new table as Transition_new for each statement execute procedure AuditTable(); create or replace function AuditTable() returns trigger

Unused indexes

2018-12-01 Thread Ron
For indexes that existed before the cluster was last started, and for which REINDEX hasn't been run on them since the cluster was last started... is it valid to say that an index has not been used since the cluster was started if these three pg_stat_all_indexes fields all have a value of 0?