The hidden cost of limit-offset

2020-12-05 Thread 孙冰
The skipped rows by an OFFSET clause have to be computed nevertheless. I am wondering if there could be any chance to improve, since the computation is on the *entire* rows rather than on the *criterial* columns. Consider the following example. Create a sample table and insert some random data.

Re: Set COLLATE on a session level

2020-12-05 Thread Laurenz Albe
On Sat, 2020-12-05 at 13:12 +0100, Peter Eisentraut wrote: > On 2020-12-04 17:18, Tom Lane wrote: > > > There is a SET COLLATION command in the SQL standard that does this. > > > Someone just has to implement it. It wouldn't be terribly difficult, I > > > think. > > > > [ squint... ] Just

Re: Using a boolean column with IF / THEN

2020-12-05 Thread David G. Johnston
On Saturday, December 5, 2020, Alexander Farber wrote: > Good evening, > > hopefully my question is not too stupid, but - > > in a 13.1 database I have a words_users table with a boolean column: > > -- the user is not allowed to chat or change the motto > muted boolean

Using a boolean column with IF / THEN

2020-12-05 Thread Alexander Farber
Good evening, hopefully my question is not too stupid, but - in a 13.1 database I have a words_users table with a boolean column: -- the user is not allowed to chat or change the motto muted boolean NOT NULL DEFAULT false, Currently I check the value as follows, but I

Re: Accessing Postgres Server and database from other Machine

2020-12-05 Thread Paul Förster
Hi Adrian, > On 05. Dec, 2020, at 15:58, Adrian Klaver wrote: > > Given that the OP changed pg_hba.conf.sample, probably not:). sorry, I overlook the *.sample part. :D Cheers, Paul

Re: Accessing Postgres Server and database from other Machine

2020-12-05 Thread Adrian Klaver
On 12/5/20 1:05 AM, Paul Förster wrote: Hi Hemil, On 05. Dec, 2020, at 07:50, Hemil Ruparel wrote: Did you restart postgres after changing pg_hba.conf? that shouldn't be necessary for changes in pg_hba.conf. Just do either on the command line: $ pg_ctl reload or from psql: postgres=#

Re: Accessing Postgres Server and database from other Machine

2020-12-05 Thread Adrian Klaver
On 12/4/20 10:26 PM, Muthukumar.GK wrote: Hi Nicklas,   I have added a line "host  all  all 0.0.0.0/0 md5" in Pg_hba_conf.sample file and restarted postgres server. Again, changing lines in the *.sample file will not be of any use. The actual pg_hba.conf file is in the

Aw: Re: Set COLLATE on a session level

2020-12-05 Thread Karsten Hilbert
> There's [...] but few differences across linguistic sorts. > These differences tend to be subtle and ignorable by end users. But _when_ they matter they matter a lot: Lists of peoples' names in some not-quite expected order are a major pain to skim over, for example. OP is in the business of

Aw: Re: Set COLLATE on a session level

2020-12-05 Thread Karsten Hilbert
> > Or a "smart" view. Set a session variable before running the > > query and have the (one) view return the locale'd data based > > on the session variable ... > > > > set session "mika.current_locale" = 'locale@2_use'; > > > > and use > > > > select

Re: Set COLLATE on a session level

2020-12-05 Thread Peter Eisentraut
On 2020-12-04 17:18, Tom Lane wrote: There is a SET COLLATION command in the SQL standard that does this. Someone just has to implement it. It wouldn't be terribly difficult, I think. [ squint... ] Just because it's in the standard doesn't mean it's a good idea. It sounds like this is

Re: Accessing Postgres Server and database from other Machine

2020-12-05 Thread Alban Hertroys
> On 5 Dec 2020, at 10:05, Paul Förster wrote: > > Hi Hemil, > >> On 05. Dec, 2020, at 07:50, Hemil Ruparel wrote: >> >> Did you restart postgres after changing pg_hba.conf? > > that shouldn't be necessary for changes in pg_hba.conf. Just do either on the > command line: > > $ pg_ctl

Re: Alter the column data type of the large data volume table.

2020-12-05 Thread charles meng
Hi Kevin, This sounds like a good idea, I will work hard on this idea and let you know the result. Most appreciated. Kevin Brannen 于2020年12月5日周六 上午12:04写道: > *>From:* Olivier Gautherot > > >>5) If you're brave enough, convert your current table as a partition > (rename it to something like

Re: Accessing Postgres Server and database from other Machine

2020-12-05 Thread Paul Förster
Hi Hemil, > On 05. Dec, 2020, at 07:50, Hemil Ruparel wrote: > > Did you restart postgres after changing pg_hba.conf? that shouldn't be necessary for changes in pg_hba.conf. Just do either on the command line: $ pg_ctl reload or from psql: postgres=# select pg_reload_conf(); You can then