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

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: > > > > > > > > > >

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.

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

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

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

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:

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

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

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

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

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

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.