Re: INSERT UNIQUE row?

2023-07-09 Thread pf
On Sun, 9 Jul 2023 16:42:15 -0700 David G. Johnston wrote: >Yes, the mechanics of defining multi-column unique constraints on tables is >covered in the docs. Good to know I'm not searching in vain...

Re: INSERT UNIQUE row?

2023-07-09 Thread pf
On Sun, 9 Jul 2023 17:04:03 -0700 Adrian Klaver wrote: >On 7/9/23 15:58, p...@pfortin.com wrote: >> Hi, >> >> Trying to figure out how to insert new property addresses into an >> existing table. >> >> Can a UNIQUE constraint be applied to an entire row? Adding UNIQUE to >> each column won't wor

Re: INSERT UNIQUE row?

2023-07-09 Thread Adrian Klaver
On 7/9/23 17:04, Adrian Klaver wrote: On 7/9/23 15:58, p...@pfortin.com wrote: Hi, Trying to figure out how to insert new property addresses into an existing table. Can a UNIQUE constraint be applied to an entire row?  Adding UNIQUE to each column won't work in such a case since there are mult

Re: INSERT UNIQUE row?

2023-07-09 Thread Adrian Klaver
On 7/9/23 15:58, p...@pfortin.com wrote: Hi, Trying to figure out how to insert new property addresses into an existing table. Can a UNIQUE constraint be applied to an entire row? Adding UNIQUE to each column won't work in such a case since there are multiple properties * on the same street *

Re: INSERT UNIQUE row?

2023-07-09 Thread David G. Johnston
On Sun, Jul 9, 2023 at 3:58 PM wrote: > Hi, > > Trying to figure out how to insert new property addresses into an > existing table. > > Can a UNIQUE constraint be applied to an entire row? Adding UNIQUE to > each column won't work in such a case since there are multiple properties > * on the sam

Re: INSERT UNIQUE row?

2023-07-09 Thread Christophe Pettus
A UNIQUE index can have any number of columns, so you can create an index with all of the appropriate columns listed. This is different from having a UNIQUE index on each individual column. In the former case, all of the columns together must be unique; in the latter case, as you mention, each

INSERT UNIQUE row?

2023-07-09 Thread pf
Hi, Trying to figure out how to insert new property addresses into an existing table. Can a UNIQUE constraint be applied to an entire row? Adding UNIQUE to each column won't work in such a case since there are multiple properties * on the same street * in the same town * with the same number on

Re: How to add function schema in search_path in option definitio

2023-07-09 Thread Adrian Klaver
On 7/9/23 13:47, Lorusso Domenico wrote: Hello Adrian and Peter, yes the set parameter in function definition is also my preferred choice, but I need to add the schema to path, not to substitute the path, this is my problem This post: https://www.postgresql.org/message-id/9f3db764-80

Re: How to add function schema in search_path in option definitio

2023-07-09 Thread Lorusso Domenico
Hello Adrian and Peter, yes the set parameter in function definition is also my preferred choice, but I need to add the schema to path, not to substitute the path, this is my problem Il giorno dom 9 lug 2023 alle ore 13:02 Peter J. Holzer ha scritto: > On 2023-07-08 19:00:02 +0200, Lorusso

Problematic enforcement of "ERROR: functions in index predicate must be marked IMMUTABLE"

2023-07-09 Thread Avi Weinberg
Hi, If you attempt to create an index based on function that is not IMMUTABLE you will get an exception "ERROR: functions in index predicate must be marked IMMUTABLE". However, if you created the index when the function was IMMUTABLE, but later on you updated the function and mistakenly remov

Re: now() literal in pg_input_is_valid

2023-07-09 Thread Tom Lane
jian he writes: > should I expect > select pg_input_is_valid($$[now(), infinity)$$,'tstzrange'); > returns true? No. "now()" is not a literal, it's a function call. regards, tom lane

Re: pgbouncer best practices

2023-07-09 Thread Rita
Thanks for the tips. So far, I am very happy with PGbouncer. Just increased number of db connections. Great piece of software! Is there a way to see how many queued connections there are? Looking at the stats I can't seem to figure that out. On Sat, Jul 8, 2023 at 9:46 AM Ben Chobot wrote: > Ri

now() literal in pg_input_is_valid

2023-07-09 Thread jian he
Hi should I expect select pg_input_is_valid($$[now(), infinity)$$,'tstzrange'); returns true?

Re: How to add function schema in search_path in option definitio

2023-07-09 Thread Peter J. Holzer
On 2023-07-08 19:00:02 +0200, Lorusso Domenico wrote: > I've created a schema to handle some specific features. > In the schema there are a couple of tables used by many functions (more than > 20). > In other words, I've created a schema as a package (as suggested in many > points). So this is one

Re: [Beginner Question]What's the use of ResTarget?

2023-07-09 Thread Alvaro Herrera
On 2023-Jul-02, Wen Yi wrote: > Hi community > When I read the Internals document (41.1. The Query Tree), > the introduction of  the 'the result relation' confuse me. There are "result relations" in commands that modify a relation, such as insert or update. The result relation is where the new t