Re: query performance

2018-02-17 Thread David Rowley
On 18 February 2018 at 12:35, hmidi slim wrote: > Is there an other optimized solution to make a query such this: > select * from ( > select e.name, e1.name, e.id > from establishment as e, establishment as e1 > where e.id <> e1.id > and e1.id = 1 > and ST_DWithin(geom, ST_MakePoint(e1.longitude,

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Tim Cross
Rich Shepard writes: > On Sat, 17 Feb 2018, Adrian Klaver wrote: > >> Got to thinking that given the issues with the upgrade I would be leery >> about the state of the new cluster as a whole. Might want to consider >> doing it over again or just use the pg_dumpall output to recreate the >> datab

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Tim Cross
Rich Shepard writes: > On Sat, 17 Feb 2018, Adrian Klaver wrote: > > > [root@salmo /etc/rc.d]# killall postgres > [root@salmo /etc/rc.d]# ./rc.postgresql start > Could not find 'postgres' binary. Maybe PostgreSQL is not installed properly? > >Yet, > > # ll /usr/bin/postgres > lrwxrwxrwx 1 r

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Rich Shepard
On Sat, 17 Feb 2018, Adrian Klaver wrote: Got to thinking that given the issues with the upgrade I would be leery about the state of the new cluster as a whole. Might want to consider doing it over again or just use the pg_dumpall output to recreate the database(s). Adrian, That's what I wa

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Adrian Klaver
On 02/17/2018 04:44 PM, Rich Shepard wrote: On Sat, 17 Feb 2018, Adrian Klaver wrote: From a previous post: POSTGRES=/usr/lib${LIBDIRSUFFIX}/@PRGNAM@/$PG_VERSION/bin/postgres From here: http://slackbuilds.org/slackbuilds/14.1/system/postgresql/postgresql.SlackBuild   The desktop runs 32

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Adrian Klaver
On 02/17/2018 04:44 PM, Rich Shepard wrote: On Sat, 17 Feb 2018, Adrian Klaver wrote: From a previous post: POSTGRES=/usr/lib${LIBDIRSUFFIX}/@PRGNAM@/$PG_VERSION/bin/postgres From here: http://slackbuilds.org/slackbuilds/14.1/system/postgresql/postgresql.SlackBuild   The desktop runs 32

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Rich Shepard
On Sat, 17 Feb 2018, Adrian Klaver wrote: From a previous post: POSTGRES=/usr/lib${LIBDIRSUFFIX}/@PRGNAM@/$PG_VERSION/bin/postgres From here: http://slackbuilds.org/slackbuilds/14.1/system/postgresql/postgresql.SlackBuild The desktop runs 32-bit 14.2. You could also try using pg_ctl to

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Adrian Klaver
On 02/17/2018 03:59 PM, Rich Shepard wrote: On Sat, 17 Feb 2018, Adrian Klaver wrote: Did pg_upgrade spit out any warnings/errors? Adrian,   Yes. The uid and gid were mis-matched and, because of that, the data/directory and all its files were owned by group user, not group postgres. In yo

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Rich Shepard
On Sat, 17 Feb 2018, Adrian Klaver wrote: Did pg_upgrade spit out any warnings/errors? Adrian, Yes. The uid and gid were mis-matched and, because of that, the data/directory and all its files were owned by group user, not group postgres. In your previous post you showed: # /etc/rc.postgre

query performance

2018-02-17 Thread hmidi slim
Hi, I have two tables: establishment which contains these columns: id, name, longitude, latitude, geom (Geometric column) Product contains: id, name, establishment_id First of all I want to select the establishment within a radius. I run this query: select e.name, e1.name from establishment as e, e

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Adrian Klaver
On 02/17/2018 02:25 PM, Rich Shepard wrote: On Sat, 17 Feb 2018, Adrian Klaver wrote: How did you upgrade, dump/restore or pg_upgrade? Adrian,   Ran 'pg_dumpall -c -f .sql' prior to doing anything. Then built, installed the new version, upgraded rc.postgresql (only differences were versio

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Rich Shepard
On Sat, 17 Feb 2018, Adrian Klaver wrote: How did you upgrade, dump/restore or pg_upgrade? Adrian, Ran 'pg_dumpall -c -f .sql' prior to doing anything. Then built, installed the new version, upgraded rc.postgresql (only differences were version numbers), and ran 'pg_upgrade ...' with the ap

Re: Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Adrian Klaver
On 02/17/2018 02:00 PM, Rich Shepard wrote: Hi folks,   Today I upgraded from -9.6.6 to -10.2 on my Slackware-14.2 desktop. The user and group IDs changed from before, but I have that all fixed now. Starting postgres (as user postgres) succeeded, but the role for me (as a use and owner of most

Re: Rationale for PUBLIC having CREATE and USAGE privileges on the schema "public" by default

2018-02-17 Thread Olegs Jeremejevs
Okay, thanks, I'll stop worrying about the defaults then. Have a nice evening! Olegs On Sat, Feb 17, 2018 at 11:49 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Saturday, February 17, 2018, Olegs Jeremejevs > wrote: > >> Okay, in other words, there's no way to completely defen

Need to fix one more glitch in upgrade to -10.2

2018-02-17 Thread Rich Shepard
Hi folks, Today I upgraded from -9.6.6 to -10.2 on my Slackware-14.2 desktop. The user and group IDs changed from before, but I have that all fixed now. Starting postgres (as user postgres) succeeded, but the role for me (as a use and owner of most databases) seems to have become lost during th

Re: Rationale for PUBLIC having CREATE and USAGE privileges on the schema "public" by default

2018-02-17 Thread David G. Johnston
On Saturday, February 17, 2018, Olegs Jeremejevs wrote: > Okay, in other words, there's no way to completely defend oneself from DoS > attacks which require having a session? If so, is there a scenario where > some bad actor can create a new user for themselves (to connect to the > database with)

Re: Rationale for PUBLIC having CREATE and USAGE privileges on the schema "public" by default

2018-02-17 Thread Tim Clarke
On 17/02/18 20:48, Olegs Jeremejevs wrote: > Okay, in other words, there's no way to completely defend oneself from > DoS attacks which require having a session? If so, is there a scenario > where some bad actor can create a new user for themselves (to connect > to the database with), and not be a

Re: Rationale for PUBLIC having CREATE and USAGE privileges on the schema "public" by default

2018-02-17 Thread Olegs Jeremejevs
Okay, in other words, there's no way to completely defend oneself from DoS attacks which require having a session? If so, is there a scenario where some bad actor can create a new user for themselves (to connect to the database with), and not be able to do anything more damaging than that? For exam

Re: Rationale for PUBLIC having CREATE and USAGE privileges on the schema "public" by default

2018-02-17 Thread David G. Johnston
On Saturday, February 17, 2018, Olegs Jeremejevs wrote: > Thanks for the reply. > > > I'm not sure whether you are really being limited/forced here or if you > are thinking that having CREATE and USAGE on a schema is more powerful than > it is... > > As far as I know, having these permissions has

Re: Rationale for PUBLIC having CREATE and USAGE privileges on the schema "public" by default

2018-02-17 Thread Olegs Jeremejevs
Thanks for the reply. > I'm not sure whether you are really being limited/forced here or if you are thinking that having CREATE and USAGE on a schema is more powerful than it is... As far as I know, having these permissions has a DoS potential, though, admittedly, negligible, if the rest of the d

Re: Any hope for more specific error message for "value too long..."?

2018-02-17 Thread Tom Lane
Ken Tanzer writes: >>> I dug in the archives and came across a crude POC hack here: >>> https://www.postgresql.org/message-id/21693.1478376...@sss.pgh.pa.us >> For that matter, it's not totally >> clear what would constitute an improvement --- what do you wish it would >> show you, exactly? > It

Re: postgres connection with port option in shell script

2018-02-17 Thread Abhra Kar
On Wed, Feb 14, 2018 at 9:03 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Feb 14, 2018 at 8:21 AM, Abhra Kar wrote: > >> Hi, >> >> I want to get postgres connection in script file. I am executing >> below command and successfully getting connected --- >> >> >> psql p

Join query

2018-02-17 Thread hmidi slim
Hi, I have two tables: establishment which contains these columns: id, name, longitude, latitude, geom (Geometric column) Product contains: id, name, establishment_id First of all I want to select the establishment within a radius. I run this query: select e.name, e1.name from establishment as e, e

Re: Any hope for more specific error message for "value too long..."?

2018-02-17 Thread Ken Tanzer
> > I dug in the archives and came across a crude POC hack here: > > https://www.postgresql.org/message-id/21693.1478376...@sss.pgh.pa.us > > At the time I didn't want to pursue it further because of Andres' > pending work on redoing expression execution, but that's landed now. > >