Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
On Tue, May 17, 2022 at 6:47 PM Bryn Llewellyn wrote: > *adrian.kla...@aklaver.com wrote:* > > b...@yugabyte.com wrote: > > The paragraph describes very surprising behavior in the present era of > "secure by default". The sentence "For maximum security..." at the end > emphasizes this and has yo

Re: Restricting user to see schema structure

2022-05-17 Thread Bryn Llewellyn
> adrian.kla...@aklaver.com wrote: > >> b...@yugabyte.com wrote: >> >> The paragraph describes very surprising behavior in the present era of >> "secure by default". The sentence "For maximum security..." at the end >> emphasizes this and has you go to some effort (CREATE and REVOKE in the same

Re: Restricting user to see schema structure

2022-05-17 Thread Adrian Klaver
On 5/17/22 13:21, Bryn Llewellyn wrote: The paragraph describes very surprising behavior in the present era of "secure by default". The sentence "For maximum security..." at the end emphasizes this and has you go to some effort (CREATE and REVOKE in the same txn) to undo the "insecurity by d

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
On Tuesday, May 17, 2022, David G. Johnston wrote: > On Tuesday, May 17, 2022, Bryn Llewellyn wrote: >> >> Might it be possible to give the paragraph more prominence (like make it >> a note and start it with "WARNING" in large letters). And to x-ref it from >> the CREATE DATABASE section? And fr

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
On Tuesday, May 17, 2022, Bryn Llewellyn wrote: > > Might it be possible to give the paragraph more prominence (like make it a > note and start it with "WARNING" in large letters). And to x-ref it from > the CREATE DATABASE section? And from the "pg_hba.conf" section? And > correspondingly from th

Re: Restricting user to see schema structure

2022-05-17 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> Right, I see the importance of this now. I now realize that when a database >> is created, CONNECT on it is automatically granted to PUBLIC. But there's no >> mention of this (or what to read to learn that this is the case)

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Adrian Klaver
On 5/17/22 9:23 AM, John W Higgins wrote: Good Morning, Just create the missing function create function to_date(timestamp with time zone, text) RETURNS text AS    'SELECT to_date($1::text, $2)::text'    LANGUAGE SQL    IMMUTABLE; That is just kicking the can down the road. What the OP

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Thomas Kellerer
gzh schrieb am 17.05.2022 um 17:55: I have had a Perl Website working for 7 years and have had no problems until at the weekend I replace my database server with a newer one. Database server (old): PostgreSQL 8.2 32bit Database server (new): PostgreSQL 9.4 64bit I run following sql in Postgre

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread David G. Johnston
On Tue, May 17, 2022 at 8:55 AM gzh wrote: > --PostgreSQL 9.4 > > --- > > SELECT to_date(now() + '-7day', '-MM-DD'); > > > > > > ERROR: function to_date(timestamp with time zone, unknown) does not ex

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread John W Higgins
Good Morning, On Tue, May 17, 2022 at 8:55 AM gzh wrote: > Hi, > > > > > ERROR: function to_date(timestamp with time zone, unknown) does not exist > > LINE 1: SELECT to_date(now() + '-7day', '-MM-DD') > >

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Tom Lane
gzh writes: > I run following sql in PostgreSQL 8.2, it return my expected result as > ¡®-MM-DD¡¯ format. > --PostgreSQL 8.2 > --- > SELECT to_date(now() + '-7day', '-MM-DD'); TBH, this was poor SQL code in 8.2, and it's poor SQL code now. to_date doesn't take timestamp, an

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Adrian Klaver
On 5/17/22 08:55, gzh wrote: Hi, I have had a Perl Website working for 7 years and have had no problems until at the weekend I replace my database server with a newer one. Database server (old): PostgreSQL 8.2 32bit Database server (new): PostgreSQL 9.4 64bit You do know 9.4 is 2 years past

Re: Restricting user to see schema structure

2022-05-17 Thread Adrian Klaver
On 5/16/22 22:21, Bryn Llewellyn wrote: Because as mentioned previously you did not "revoke connect on database postgres from public". Right, I see the importance of this now. I now realize that when a database is created, CONNECT on it is automatically granted to PUBLIC. But there's no ment

TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread gzh
Hi, I have had a Perl Website working for 7 years and have had no problems until at the weekend I replace my database server with a newer one. Database server (old): PostgreSQL 8.2 32bit Database server (new): PostgreSQL 9.4 64bit I run following sql in PostgreSQL 8.2, it return my ex

Parallel not working

2022-05-17 Thread huangning...@yahoo.com
Hi: I write a  C function, the function is as follows: create function st_geosotgrid(geom geometry, level integer) returns geosotgrid[] immutable strict parallel safe language c as $$ begin -- missing source code end; $$; At the same time, I set the relevant parameters: force_pa

Postgres AST Deparser for Postgres

2022-05-17 Thread Dan Lynch
HI all! I wanted to share a useful tool that I built during the pandemic. (if this is the wrong mailing list, please let me know where I should be sharing this, thanks) I do a lot of functional programming and need dynamic SQL. My personal belief is that ORMs are the wrong interface to creating m

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
On Mon, May 16, 2022 at 10:21 PM Bryn Llewellyn wrote: > > Right, I see the importance of this now. I now realize that when a > database is created, CONNECT on it is automatically granted to PUBLIC. But > there's no mention of this (or what to read to learn that this is the case) > in the "pg_hba

Re: Alternative to slow SRF in SELECT?

2022-05-17 Thread David G. Johnston
On Tue, May 17, 2022 at 7:19 AM Markur Sens wrote: > I have the following case > > > select > my_srf_func(otherfunc(h)) > from (values (‘…’::mytype), > > as temp(h); > > > > Any alternatives on how I could rework the query or the my_srf_func to speed > things up, without having t

Alternative to slow SRF in SELECT?

2022-05-17 Thread Markur Sens
I have the following case select my_srf_func(otherfunc(h)) from (values (‘…’::mytype), ‘…’::mytype), (‘…’::mytype), ‘…’::mytype), (‘…’::mytype),) as temp(h); I think it’s obvious what I’m trying to do. My_srf_func is similar

Row level security insert policy does not validate update new values/content?

2022-05-17 Thread alias
*Hi,* *original query* > BEGIN; > RESET session AUTHORIZATION; > SET search_path = test; > SET session AUTHORIZATION alice; > CREATE TABLE emp ( > name text, > paydate date, > income numeric > ); > GRANT ALL ON TABLE emp TO public; > INSERT INTO emp > VALUES ('John', '12-01-2009',