Gurjeet Singh Index Adviser User Interface

2020-09-28 Thread Yessica Brinkmann
Goodnight, I would like to ask the following question: As some of you may recall, I was doing my university thesis as a modification of Gurjeet Singh's Index Adviser. Now I have finished the programming part. But I have the following problem: Gurjeet Singh's Index Adviser readme describes how to

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Tom Lane
Joe Abbate writes: > On 28/9/20 17:25, Tom Lane wrote: >> Domain-over-composite might be a slightly simpler answer than your first >> one. It's only available in relatively late-model PG, and I'm not sure >> about its performance relative to your other design, but it is an >> alternative to

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Adrian Klaver
On 9/28/20 2:58 PM, Joe Abbate wrote: Hello Tom, On 28/9/20 17:25, Tom Lane wrote: Domain-over-composite might be a slightly simpler answer than your first one.  It's only available in relatively late-model PG, and I'm not sure about its performance relative to your other design, but it is an

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Joe Abbate
Hello Gavan, On 28/9/20 17:52, Gavan Schneider wrote: Consider expressing all the component fields as a range. This allows you the ability to be a precise as you need and still have the benefits of well defined comparison functions. I did consider that, but it's a tradeoff between 80% of the

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Joe Abbate
Hello Tom, On 28/9/20 17:25, Tom Lane wrote: Domain-over-composite might be a slightly simpler answer than your first one. It's only available in relatively late-model PG, and I'm not sure about its performance relative to your other design, but it is an alternative to think about.

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Gavan Schneider
On 29 Sep 2020, at 7:31, Joe Abbate wrote: Hello Rob, On 28/9/20 17:17, Rob Sargent wrote: just record all three fields (day, month, year) with nulls and do the to-date as needed. That is not sufficient. An earlier implementation had something like a CHAR(8) to record MMDD, but how

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Ron
On 9/28/20 4:31 PM, Joe Abbate wrote: Hello Rob, On 28/9/20 17:17, Rob Sargent wrote: just record all three fields (day, month, year) with nulls and do the to-date as needed. That is not sufficient.  An earlier implementation had something like a CHAR(8) to record MMDD, but how can you

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Joe Abbate
Hello Rob, On 28/9/20 17:17, Rob Sargent wrote: just record all three fields (day, month, year) with nulls and do the to-date as needed. That is not sufficient. An earlier implementation had something like a CHAR(8) to record MMDD, but how can you indicate, for example, an issue date

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Tom Lane
Joe Abbate writes: > I'm considering creating a TYPE for what may be called a "possibly > imprecise date" (pidate). > The first option I explored was creating a composite type with the two > attributes, but that doesn't allow specification of DEFAULTs, NOT NULL > or CHECK expressions on the

Re: DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Rob Sargent
> On Sep 28, 2020, at 3:14 PM, Joe Abbate wrote: > > Hello, > > I'm considering creating a TYPE for what may be called a "possibly imprecise > date" (pidate). The most obvious use is for recording dates such as births > or deaths of historical individuals, where we may know that someone

DOMAIN/composite TYPE vs. base TYPE

2020-09-28 Thread Joe Abbate
Hello, I'm considering creating a TYPE for what may be called a "possibly imprecise date" (pidate). The most obvious use is for recording dates such as births or deaths of historical individuals, where we may know that someone died precisely on a given year-month-day, but the birth may only

Re: Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
On Mon, 28 Sep 2020, Tom Lane wrote: No part-timers in your universe? (My friends in the restaurant business would surely find the above pretty laughable.) Tom, Not in the markets I serve; at least, not at the environmental manager level. I don't work for retail businesses; primarily natural

Re: Modifying database schema without losing data

2020-09-28 Thread Tom Lane
Rich Shepard writes: > On Mon, 28 Sep 2020, Adam Scott wrote: >> What if a person is a member of more than one Org? Consider a person_org >> table. > Not applicable. An individual is employed by a single organization. No part-timers in your universe? (My friends in the restaurant business

Re: Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
On Mon, 28 Sep 2020, Adam Scott wrote: What if a person is a member of more than one Org? Consider a person_org table. Adam, Not applicable. An individual is employed by a single organization. I see mention of a site in the person table. It may also be the case that you need a site

Re: re PG 9.6x and found xmin from before relfrozenxid and removal of pg_internal.init file(s)

2020-09-28 Thread Tom Lane
Reid Thompson writes: > On Mon, 2020-09-28 at 12:15 -0400, Tom Lane wrote: >> I'm a bit dubious that that'd actually help, but it's perfectly safe >> if you want to try it. pg_internal.init is just a cache file that >> will be rebuilt if it's missing. > appears to allow to vacuum to complete...

Re: Modifying database schema without losing data

2020-09-28 Thread Adam Scott
What if a person is a member of more than one Org? Consider a person_org table. I see mention of a site in the person table. It may also be the case that you need a site table. Often, you want a table for the Person and a Contact (or Address) table separately. This allows for having more

Re: re PG 9.6x and found xmin from before relfrozenxid and removal of pg_internal.init file(s)

2020-09-28 Thread Reid Thompson
On Mon, 2020-09-28 at 12:15 -0400, Tom Lane wrote: > Reid Thompson writes: > > We have a planned upgrade that would permanentlty remedy this. > > regarding the below errors on our PG 9.6.x instance. > > > 2020-09-28 09:08:15.741 EDT,,,26212,,5f71e03f.6664,1,,2020-09-28 09:08:15 > >

Re: Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
On Mon, 28 Sep 2020, Adrian Klaver wrote: You could use INSERT INTO location(new_fields,) SELECT the_fields FROM the_table(s). Well, duh! I could have thought of that. That's exactly what I'll do: Create the new table, move data from the old table into it, then drop columns in the old table

Re: Modifying database schema without losing data

2020-09-28 Thread Adrian Klaver
On 9/28/20 10:15 AM, Rich Shepard wrote: I've been developing a business tracking application for my own use and it's worked well up to now. But, I need to modify it by adding a table with attributes from two other tables. I've not drawn a E-R diagram so I show the two existing tables here:

Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
I've been developing a business tracking application for my own use and it's worked well up to now. But, I need to modify it by adding a table with attributes from two other tables. I've not drawn a E-R diagram so I show the two existing tables here: CREATE TABLE Organizations ( org_id serial

Re: re PG 9.6x and found xmin from before relfrozenxid and removal of pg_internal.init file(s)

2020-09-28 Thread Tom Lane
Reid Thompson writes: > We have a planned upgrade that would permanentlty remedy this. > regarding the below errors on our PG 9.6.x instance. > 2020-09-28 09:08:15.741 EDT,,,26212,,5f71e03f.6664,1,,2020-09-28 09:08:15 > EDT,250/9136136,0,ERROR,XX001,"found xmin 2675436435 from before

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Paul Förster
Hi Adrian, > On 28. Sep, 2020, at 16:30, Adrian Klaver wrote: > Not necessarily, if it is installing plpythonu functions. I'll have to check that anyway. I'm already logged out of work, so I won't do that now.  Cheers, Paul

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Adrian Klaver
On 9/28/20 7:22 AM, Paul Förster wrote: Hi Adrian, On 28. Sep, 2020, at 16:03, Adrian Klaver wrote: So pgwatch2 installs functions that use plpythonu? How does that work if there is no plpython language installed? at work, the extension is installed everywhere. But it seems we have an old

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Paul Förster
Hi Adrian, > On 28. Sep, 2020, at 16:03, Adrian Klaver wrote: > > So pgwatch2 installs functions that use plpythonu? > How does that work if there is no plpython language installed? at work, the extension is installed everywhere. But it seems we have an old version. The current version seems

re PG 9.6x and found xmin from before relfrozenxid and removal of pg_internal.init file(s)

2020-09-28 Thread Reid Thompson
We have a planned upgrade that would permanentlty remedy this. regarding the below errors on our PG 9.6.x instance. 2020-09-28 09:08:15.741 EDT,,,26212,,5f71e03f.6664,1,,2020-09-28 09:08:15 EDT,250/9136136,0,ERROR,XX001,"found xmin 2675436435 from before relfrozenxid 321165377","automatic

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Adrian Klaver
On 9/28/20 6:37 AM, Paul Förster wrote: Hi Adrian, On 28. Sep, 2020, at 15:34, Adrian Klaver wrote: Well I'm out of ideas. That means circling back to having Python 2 installed, should the powers that be agree. they don't. But fortunately, it seems that the number of applications which

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Paul Förster
Hi Adrian, > On 28. Sep, 2020, at 15:34, Adrian Klaver wrote: > > Well I'm out of ideas. That means circling back to having Python 2 installed, > should the powers that be agree. they don't. But fortunately, it seems that the number of applications which use Python code inside a database,

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Adrian Klaver
On 9/28/20 12:46 AM, Paul Förster wrote: Hi Adrian, On 27. Sep, 2020, at 19:30, Adrian Klaver wrote: Does: SELECT lanname, proname, probin FROM pg_proc JOIN pg_language ON pg_language.oid = pg_proc.prolang WHERE pg_language.lanname='plpythonu' AND probin IS NOT NULL;

DB upgrade version compatibility

2020-09-28 Thread Brajendra Pratap Singh
Can we upgrade the 9.6version open source postgresql db directly to 12.3version ? Thanks and Regards, Singh

Re: Question about using ICU

2020-09-28 Thread Paul Förster
Hi Laurenz, > On 28. Sep, 2020, at 13:13, Laurenz Albe wrote: >> >> but then I'd have to do a reindex anyway, right? My goal was to avoid the >> reindex altogether, if possible. > > That couldn't be avoided anyway if you change the collation no matter > if you do it on the database or on the

Re: how to switch off: WARNING: psql major version 11, server major version 13

2020-09-28 Thread Ireneusz Pluta/wp.pl
W dniu 2020-09-28 o 13:39, Matthias Apitz pisze: El día lunes, septiembre 28, 2020 a las 12:17:26p. m. +0200, Paul Förster escribió: $ psql -Usisis -dsisis SET psql (11.4, server 13.0) WARNING: psql major version 11, server major version 13. Some psql features might not work. Type

Re: how to switch off: WARNING: psql major version 11, server major version 13

2020-09-28 Thread Ian Barwick
On 2020/09/28 19:06, Matthias Apitz wrote: Hello, Maybe it's a FAQ, but I haven't seen the answer. I want to switch of the warning (because I know the fact of version not matching): $ psql -Usisis -dsisis SET psql (11.4, server 13.0) WARNING: psql major version 11, server major version 13.

Re: how to switch off: WARNING: psql major version 11, server major version 13

2020-09-28 Thread Matthias Apitz
El día lunes, septiembre 28, 2020 a las 12:17:26p. m. +0200, Paul Förster escribió: > > $ psql -Usisis -dsisis > > SET > > psql (11.4, server 13.0) > > WARNING: psql major version 11, server major version 13. > > Some psql features might not work. > > Type "help" for help. > > > >

Re: Question about using ICU

2020-09-28 Thread Laurenz Albe
On Mon, 2020-09-28 at 11:45 +0200, Paul Förster wrote: > > Your best bet is to manually change the definition of all columns to use > > the new collation. > > psql's \gexec may help. > > but then I'd have to do a reindex anyway, right? My goal was to avoid the > reindex altogether, if possible.

Re: how to switch off: WARNING: psql major version 11, server major version 13

2020-09-28 Thread Paul Förster
Hi Matthias, > On 28. Sep, 2020, at 12:06, Matthias Apitz wrote: > > > Hello, > > Maybe it's a FAQ, but I haven't seen the answer. I want to switch of the > warning (because I know the fact of version not matching): > > $ psql -Usisis -dsisis > SET > psql (11.4, server 13.0) > WARNING: psql

how to switch off: WARNING: psql major version 11, server major version 13

2020-09-28 Thread Matthias Apitz
Hello, Maybe it's a FAQ, but I haven't seen the answer. I want to switch of the warning (because I know the fact of version not matching): $ psql -Usisis -dsisis SET psql (11.4, server 13.0) WARNING: psql major version 11, server major version 13. Some psql features might not work.

Re: Question about using ICU

2020-09-28 Thread Paul Förster
Hi Laurenz, > On 28. Sep, 2020, at 11:04, Laurenz Albe wrote: > > There have been efforts to add this functionality: > https://www.postgresql.org/message-id/flat/5e756dd6-0e91-d778-96fd-b1bcb06c161a%402ndquadrant.com > but it didn't get done. seems to be a rather complex thing according to the

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-28 Thread Laurenz Albe
On Sun, 2020-09-27 at 17:16 -0400, aNullValue (Drew Stemen) wrote: > I've attempted to obtain help with this problem from several other places, > but numerous > individuals recommended I ask this mailing list. > > What I need is for the ability to return a timestamp with timezone, using the >

Re: Question about using ICU

2020-09-28 Thread Laurenz Albe
On Mon, 2020-09-28 at 10:02 +0200, Paul Förster wrote: > I have a general question about the use of ICU. Currently, we have PostgreSQL > compiled > from source (Linux) without ICU support. All database clusters and databases > are UTF8 > and of course relying on glibc. > > With the sooner or

Question about using ICU

2020-09-28 Thread Paul Förster
Hi, I have a general question about the use of ICU. Currently, we have PostgreSQL compiled from source (Linux) without ICU support. All database clusters and databases are UTF8 and of course relying on glibc. With the sooner or later upcoming glibc release 2.28, there will probably a big

Re: pg_upgrade Python version issue on openSUSE

2020-09-28 Thread Paul Förster
Hi Adrian, > On 27. Sep, 2020, at 19:30, Adrian Klaver wrote: > > Does: > > SELECT >lanname, proname, probin > FROM >pg_proc > JOIN >pg_language > ON >pg_language.oid = pg_proc.prolang > WHERE >pg_language.lanname='plpythonu' > AND > probin IS NOT NULL; > > show