Re: Syntax question about returning value from an insert

2019-12-25 Thread Adrian Klaver
On 12/25/19 3:09 PM, stan wrote: On Wed, Dec 25, 2019 at 02:34:43PM -0800, Adrian Klaver wrote: On 12/25/19 12:39 PM, stan wrote: Other approaches have been suggested, e.g. use a traditional FK relationship. The big unknown in you present system is what: SELECT cost_category_key from t2 w

Re: Syntax question about returning value from an insert

2019-12-25 Thread Adrian Klaver
On 12/25/19 4:48 PM, Rob Sargent wrote: On Dec 25, 2019, at 3:10 PM, stan wrote: There is more that that. There is a project number, so the actuall key represents the combination of project number, and cost category, Thire is a constraint on T2 that assures that these combinations will be uni

Re: Syntax question about returning value from an insert

2019-12-25 Thread Rob Sargent
> On Dec 25, 2019, at 3:10 PM, stan wrote: > There is more that that. There is a project number, so the actuall key > represents the combination of project number, and cost category, Thire is a > constraint on T2 that assures that these combinations will be unique. > > When the 1st record for

Re: Syntax question about returning value from an insert

2019-12-25 Thread stan
On Wed, Dec 25, 2019 at 06:09:55PM -0500, stan wrote: > On Wed, Dec 25, 2019 at 02:34:43PM -0800, Adrian Klaver wrote: > > On 12/25/19 12:39 PM, stan wrote: > > > > > > On Wed, Dec 25, 2019 at 11:55:51AM -0800, Adrian Klaver wrote: > > > > On 12/25/19 11:08 AM, stan wrote: > > > > > > > > > > O

Re: Syntax question about returning value from an insert

2019-12-25 Thread stan
On Wed, Dec 25, 2019 at 02:34:43PM -0800, Adrian Klaver wrote: > On 12/25/19 12:39 PM, stan wrote: > > > > On Wed, Dec 25, 2019 at 11:55:51AM -0800, Adrian Klaver wrote: > > > On 12/25/19 11:08 AM, stan wrote: > > > > > > > > On Wed, Dec 25, 2019 at 08:28:45AM -0800, Adrian Klaver wrote: > > > >

Re: Syntax question about returning value from an insert

2019-12-25 Thread Adrian Klaver
On 12/25/19 12:39 PM, stan wrote: On Wed, Dec 25, 2019 at 11:55:51AM -0800, Adrian Klaver wrote: On 12/25/19 11:08 AM, stan wrote: On Wed, Dec 25, 2019 at 08:28:45AM -0800, Adrian Klaver wrote: On 12/25/19 7:26 AM, stan wrote: I am writing a trigger/function to make certain a default item,

Re: Syntax question about returning value from an insert

2019-12-25 Thread Rob Sargent
> On Dec 25, 2019, at 11:56 AM, Adrian Klaver < >> First of all, thanks to both of you for your fast response . >> Let me clarify. >> I have a table that records will be inserted into. Several of the columns >> in this table must be non NULL, and they are actually keys from other >> tables. Lik

Re: Syntax question about returning value from an insert

2019-12-25 Thread stan
On Wed, Dec 25, 2019 at 11:55:51AM -0800, Adrian Klaver wrote: > On 12/25/19 11:08 AM, stan wrote: > > > > On Wed, Dec 25, 2019 at 08:28:45AM -0800, Adrian Klaver wrote: > > > On 12/25/19 7:26 AM, stan wrote: > > > > I am writing a trigger/function to make certain a default item, and its > > >

Re: Syntax question about returning value from an insert

2019-12-25 Thread Adrian Klaver
On 12/25/19 11:08 AM, stan wrote: On Wed, Dec 25, 2019 at 08:28:45AM -0800, Adrian Klaver wrote: On 12/25/19 7:26 AM, stan wrote: I am writing a trigger/function to make certain a default item, and its key exist when an insert is called. EG The trigger gets called on insert to T1 If column c1

Re: Syntax question about returning value from an insert

2019-12-25 Thread stan
On Wed, Dec 25, 2019 at 08:28:45AM -0800, Adrian Klaver wrote: > On 12/25/19 7:26 AM, stan wrote: > > I am writing a trigger/function to make certain a default item, and its key > > exist when an insert is called. EG > > > > The trigger gets called on insert to T1 If column c1 is NULL in the NEW

Re: Syntax question about returning value from an insert

2019-12-25 Thread Adrian Klaver
On 12/25/19 7:26 AM, stan wrote: I am writing a trigger/function to make certain a default item, and its key exist when an insert is called. EG The trigger gets called on insert to T1 If column c1 is NULL in the NEW structure, I need to check table t2 to get the key associated with the default f

Re: Backup and Restore

2019-12-25 Thread Adrian Klaver
On 12/25/19 5:34 AM, Dor Ben Dov wrote: Hi All, What Is the best recommended / used tool for backup and restore that you suggest or work with postgres ? This is the second time around for this question: https://www.postgresql.org/message-id/AM0PR06MB4817A7035134FD88B2C1D033CC550%40AM0PR06MB4

Re: Backup and Restore

2019-12-25 Thread Ron
On 12/25/19 7:46 AM, Andreas Kretschmer wrote: Am 25.12.19 um 14:34 schrieb Dor Ben Dov: Hi All, What Is the best recommended / used tool for backup and restore that you suggest or work with postgres ? depends on your needs, most of our customers using barman. pgbackrest is also popul

Re: Syntax question about returning value from an insert

2019-12-25 Thread Pavel Stehule
Hi st 25. 12. 2019 v 16:26 odesílatel stan napsal: > I am writing a trigger/function to make certain a default item, and its key > exist when an insert is called. EG > > The trigger gets called on insert to T1 If column c1 is NULL in the NEW > structure, I need to check table t2 to get the key a

Re: Question on upgrading postgresql from 10.7 to 11.5

2019-12-25 Thread Julien Rouhaud
On Wed, Dec 25, 2019 at 3:42 PM Lu, Dan wrote: > > Hello, > > I am trying to upgrade my PG instance from 10.7 to 11.5. > > I got an error in doing so. Any idea what I am missing? > > Example: pg_upgrade -d /hostname/pg/dpoc/data -D /hostname/pg/dpoc115/data -b > /hostname/pg/PostgreSQL-10.7/bin

Syntax question about returning value from an insert

2019-12-25 Thread stan
I am writing a trigger/function to make certain a default item, and its key exist when an insert is called. EG The trigger gets called on insert to T1 If column c1 is NULL in the NEW structure, I need to check table t2 to get the key associated with the default for this column. However, if the def

Re: Date created for tables

2019-12-25 Thread Melvin Davidson
AFAICT, this is something that should have been designed into the initial release of PostgreSQL, but rather than go down that road, I have thought about this and will attempt to explain the "complexity" of implementing it, which to date has only been described as too hard or, we don't have enough d

Question on upgrading postgresql from 10.7 to 11.5

2019-12-25 Thread Lu, Dan
Hello, I am trying to upgrade my PG instance from 10.7 to 11.5. I got an error in doing so. Any idea what I am missing? Example: pg_upgrade -d /hostname/pg/dpoc/data -D /hostname/pg/dpoc115/data -b /hostname/pg/PostgreSQL-10.7/bin -B /hostname/pg/PostgreSQL-11.5/bin -p 5432 -P 9432 -c -v Err

Re: Backup and Restore

2019-12-25 Thread Andreas Kretschmer
Am 25.12.19 um 14:34 schrieb Dor Ben Dov: Hi All, What Is the best recommended / used tool for backup and restore that you suggest or work with postgres ? depends on your needs, most of our customers using barman. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2n

Backup and Restore

2019-12-25 Thread Dor Ben Dov
Hi All, What Is the best recommended / used tool for backup and restore that you suggest or work with postgres ? Regards, Dor This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdo