Re: How do I enabled Windows 10 to be able to run PSQL etc

Rob Sargent <[email protected]> Sun, 8 Sep 2019 20:30:01 -0600
Newsgroups gmane.comp.db.postgresql.sql
Message-ID <[email protected]>
--Apple-Mail-EA94AC4D-7B7C-4ED8-AED4-05449921B0FA
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable



> On Sep 7, 2019, at 10:11 PM, Karen Goh <[email protected]> wrote:
>=20
>=20
> Hi Rob,
>=20
> Your suggestion to use create table schema.table doesn't work and I have a=
lready tried this and exhausted my own solving skill before I posted it here=
.
>=20
> And when the table is not there, what is the point of using Alter statemen=
t ?
>=20
> By =E2=80=98under postgres=E2=80=99 do you mean owned by Postgres in the p=
ublic schema or in the postgres database - Please see attached picture - tha=
t PGAdmin 4 is using postgres - it is the same username as what I have creat=
ed and as an access when using runpsql.batch.
>=20
> Oyeah...does anybody know how do I access psql in Winodws 10 ? So far, no r=
eply here... Please let me know if I should write to the committee or ?
>=20
> On Saturday, September 7, 2019, 11:51:23 PM GMT+8, Rob Sargent <robjsargen=
[email protected]> wrote:
>=20
>=20
>=20
>=20
> > On Sep 7, 2019, at 8:04 AM, Karen Goh <[email protected]> wrote:
> >=20
> > Hi Rob,
> >=20
> > At pgAdmin 4, it shows I am in postgres/postgres@PostgreSQL11
> >=20
> > I have created a table there using CREATE public.TABLE follows by name b=
lah..
> >=20
> > When I executed the SQL, it said successful but it didn't appear togethe=
r in the Schema - membership.
> >=20
> > So, I tried to use membership.TableName but it doesn't allow so I though=
t maybe this is the way Postgesql work - differ from MYSQL.
> >=20
> > So, now, How do I add in the table that I want?
> >=20
> > So, the thing is that it is already showing me I am in postgres, how do I=
 alter it then ? Alter it to what ?
> >=20
> > On Saturday, September 7, 2019, 10:07:56 PM GMT+8, Rob Sargent <robjsarg=
[email protected]> wrote:
> >=20
> >=20
> >=20
> >=20
> > > On Sep 7, 2019, at 5:26 AM, Karen Goh <[email protected]> wrote:
> > >
> > > Hello experts,
> > >
> > > Ever since I found out I have a different versions of Postgresql resid=
ing in my PC, I have deleted the old version - 10 and 7 altogether and insta=
lled version 11.
> > >
> > > So, all look good except that I can't use PSQL at all.
> > >
> > > Then, I found out that there is a security tied to using PSQL in Windo=
ws 10. However, I tried to alter the setting for DESKTOP user to Full-Contro=
l I can't find a way to do it. Neither can I find anything from the internet=
.
> > >
> > > Please advise how do I alter the setting so that I can use PSQL freely=
.=20
> > >
> > > I had tried to use runpsql.batch after reading a Stackoverflow user ad=
vice.
> > >
> > > But, when I tried to do some psql comments, it doesn't work.
> > >
> > > What is that comment you might ask - which is my next problem - this c=
omment is to allow me to merge a table which I have created in PGAdmin 4 int=
o a schema - membership which has 3 tables there already.
> > >
> > > The thing is that I found that the table which I have created, it is n=
ot able to appear under the schema - memberships. But, when I used runpsql.b=
atch, and use /l , it will show up as a table but under postgres.
> > >
> > > Now, in my PGAdmin 4, I did not create a user name either, it is also u=
sing postgres as user name so why is the table not appear as a table even af=
ter I refreshed.
> > >
> > > So, I hope someone can tell me the solutions to the above problem.
> > >
> > > Thanks & regards,
> > > Karen
> >=20
> > >
> > >
> > Without a user everything will be owned by Postgres account but that=E2=80=
=99s ok.
> > By =E2=80=98under postgres=E2=80=99 do you mean owned by Postgres in the=
 public schema or in the postgres database. If the latter then your pgadmin c=
onnection settings need the name of the database to use. Your table needs to=
 be fully qualified by adding the schema name:
> > create table schema.table
> > You can use the alter table statement to reset the schema for the existi=
ng table or drop table/create table if that=E2=80=99s easier for you.
>=20
> >=20
> Sorry Karen I=E2=80=99m not at my desk or I could give you url. You=E2=80=99=
ll have to google Postgres alter table command. I use neither windows nor pg=
admin
>=20
> >
> <picture to show postges in PGAdmin4.jpg>
Karen
=46rom the screenshot I think membership is one of two databases on that ser=
ver. The other db is called postgres (made by Postgres in almost every datab=
ase you create) and I suspect your table definition is in the public schema o=
f postgres database. membership has only the default schema which is called p=
ublic. I can=E2=80=99t identify any table definitions in the screenshot.=20
I think you need to add =E2=80=9Cmembership=E2=80=9D to your pgadmin connect=
ion string=

--Apple-Mail-EA94AC4D-7B7C-4ED8-AED4-05449921B0FA
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"><span></span></div><div di=
r=3D"ltr"><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"><div dir=3D"ltr"></div><div dir=3D"ltr"><br></div><div dir=3D"ltr"><b=
r>On Sep 7, 2019, at 10:11 PM, Karen Goh &lt;<a href=3D"mailto:karenworld@ya=
hoo.com">[email protected]</a>&gt; wrote:<br><br></div><blockquote type=3D=
"cite"><div dir=3D"ltr"><div>                <br>Hi Rob,<br><br>Your suggest=
ion to use create table schema.table doesn't work and I have already tried t=
his and exhausted my own solving skill before I posted it here.<br><br>And w=
hen the table is not there, what is the point of using Alter statement ?<br>=
<br>By =E2=80=98under postgres=E2=80=99 do you mean owned by Postgres in the=
 public schema or in the postgres database - Please see attached picture - t=
hat PGAdmin 4 is using postgres - it is the same username as what I have cre=
ated and as an access when using runpsql.batch.<br><br>Oyeah...does anybody k=
now how do I access psql in Winodws 10 ? So far, no reply here... Please let=
 me know if I should write to the committee or ?<br><br>            </div>  =
          <div class=3D"yahoo_quoted" style=3D"margin:10px 0px 0px 0.8ex;bor=
der-left:1px solid #ccc;padding-left:1ex;">                                 =
   <div style=3D"font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;=
font-size:13px;color:#26282a;">                                <div>        =
            On Saturday, September 7, 2019, 11:51:23 PM GMT+8, Rob Sargent &=
lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wr=
ote:                </div>                <div><br clear=3D"none"></div>    =
            <div><br clear=3D"none"></div>                <div><div dir=3D"l=
tr"><br clear=3D"none"><div class=3D"yiv5702156559yqt2427780157" id=3D"yiv57=
02156559yqtfd42441"><br clear=3D"none">&gt; On Sep 7, 2019, at 8:04 AM, Kare=
n Goh &lt;<a rel=3D"nofollow" shape=3D"rect" ymailto=3D"mailto:karenworld@ya=
hoo.com" target=3D"_blank" href=3D"mailto:[email protected]">karenworld@y=
ahoo.com</a>&gt; wrote:<br clear=3D"none">&gt; <br clear=3D"none">&gt; Hi Ro=
b,<br clear=3D"none">&gt; <br clear=3D"none">&gt; At pgAdmin 4, it shows I a=
m in postgres/<a rel=3D"nofollow" shape=3D"rect" ymailto=3D"mailto:postgres@=
PostgreSQL11" target=3D"_blank" href=3D"mailto:postgres@PostgreSQL11">postgr=
es@PostgreSQL11</a><br clear=3D"none">&gt; <br clear=3D"none">&gt; I have cr=
eated a table there using CREATE public.TABLE follows by name blah..<br clea=
r=3D"none">&gt; <br clear=3D"none">&gt; When I executed the SQL, it said suc=
cessful but it didn't appear together in the Schema - membership.<br clear=3D=
"none">&gt; <br clear=3D"none">&gt; So, I tried to use membership.TableName b=
ut it doesn't allow so I thought maybe this is the way Postgesql work - diff=
er from MYSQL.<br clear=3D"none">&gt; <br clear=3D"none">&gt; So, now, How d=
o I add in the table that I want?<br clear=3D"none">&gt; <br clear=3D"none">=
&gt; So, the thing is that it is already showing me I am in postgres, how do=
 I alter it then ? Alter it to what ?<br clear=3D"none">&gt; <br clear=3D"no=
ne">&gt; On Saturday, September 7, 2019, 10:07:56 PM GMT+8, Rob Sargent &lt;=
<a rel=3D"nofollow" shape=3D"rect" ymailto=3D"mailto:[email protected]" t=
arget=3D"_blank" href=3D"mailto:[email protected]">[email protected]=
</a>&gt; wrote:<br clear=3D"none">&gt; <br clear=3D"none">&gt; <br clear=3D"=
none">&gt; <br clear=3D"none">&gt; <br clear=3D"none">&gt; &gt; On Sep 7, 20=
19, at 5:26 AM, Karen Goh &lt;<a rel=3D"nofollow" shape=3D"rect" ymailto=3D"=
mailto:[email protected]" target=3D"_blank" href=3D"mailto:karenworld@yah=
oo.com">[email protected]</a>&gt; wrote:<br clear=3D"none">&gt; &gt;<br c=
lear=3D"none">&gt; &gt; Hello experts,<br clear=3D"none">&gt; &gt;<br clear=3D=
"none">&gt; &gt; Ever since I found out I have a different versions of Postg=
resql residing in my PC, I have deleted the old version - 10 and 7 altogethe=
r and installed version 11.<br clear=3D"none">&gt; &gt;<br clear=3D"none">&g=
t; &gt; So, all look good except that I can't use PSQL at all.<br clear=3D"n=
one">&gt; &gt;<br clear=3D"none">&gt; &gt; Then, I found out that there is a=
 security tied to using PSQL in Windows 10. However, I tried to alter the se=
tting for DESKTOP user to Full-Control I can't find a way to do it. Neither c=
an I find anything from the internet.<br clear=3D"none">&gt; &gt;<br clear=3D=
"none">&gt; &gt; Please advise how do I alter the setting so that I can use P=
SQL freely. <br clear=3D"none">&gt; &gt;<br clear=3D"none">&gt; &gt; I had t=
ried to use runpsql.batch after reading a Stackoverflow user advice.<br clea=
r=3D"none">&gt; &gt;<br clear=3D"none">&gt; &gt; But, when I tried to do som=
e psql comments, it doesn't work.<br clear=3D"none">&gt; &gt;<br clear=3D"no=
ne">&gt; &gt; What is that comment you might ask - which is my next problem -=
 this comment is to allow me to merge a table which I have created in PGAdmi=
n 4 into a schema - membership which has 3 tables there already.<br clear=3D=
"none">&gt; &gt;<br clear=3D"none">&gt; &gt; The thing is that I found that t=
he table which I have created, it is not able to appear under the schema - m=
emberships. But, when I used runpsql.batch, and use /l , it will show up as a=
 table but under postgres.<br clear=3D"none">&gt; &gt;<br clear=3D"none">&gt=
; &gt; Now, in my PGAdmin 4, I did not create a user name either, it is also=
 using postgres as user name so why is the table not appear as a table even a=
fter I refreshed.<br clear=3D"none">&gt; &gt;<br clear=3D"none">&gt; &gt; So=
, I hope someone can tell me the solutions to the above problem.<br clear=3D=
"none">&gt; &gt;<br clear=3D"none">&gt; &gt; Thanks &amp; regards,<br clear=3D=
"none">&gt; &gt; Karen<br clear=3D"none">&gt; <br clear=3D"none">&gt; &gt;<b=
r clear=3D"none">&gt; &gt;<br clear=3D"none">&gt; Without a user everything w=
ill be owned by Postgres account but that=E2=80=99s ok.<br clear=3D"none">&g=
t; By =E2=80=98under postgres=E2=80=99 do you mean owned by Postgres in the p=
ublic schema or in the postgres database. If the latter then your pgadmin co=
nnection settings need the name of the database to use. Your table needs to b=
e fully qualified by adding the schema name:<br clear=3D"none">&gt; create t=
able schema.table<br clear=3D"none">&gt; You can use the alter table stateme=
nt to reset the schema for the existing table or drop table/create table if t=
hat=E2=80=99s easier for you.</div><br clear=3D"none">&gt; <br clear=3D"none=
">Sorry Karen I=E2=80=99m not at my desk or I could give you url. You=E2=80=99=
ll have to google Postgres alter table command. I use neither windows nor pg=
admin<div class=3D"yiv5702156559yqt2427780157" id=3D"yiv5702156559yqtfd01165=
"><br clear=3D"none">&gt; </div></div></div>            </div>              =
          </div></div></blockquote><blockquote type=3D"cite"><div dir=3D"ltr=
">&lt;picture to show postges in  PGAdmin4.jpg&gt;</div></blockquote>Karen<d=
iv>=46rom the screenshot I think membership is one of two databases on that s=
erver. The other db is called postgres (made by Postgres in almost every dat=
abase you create) and I suspect your table definition is in the public schem=
a of postgres database. membership has only the default schema which is call=
ed public. I can=E2=80=99t identify any table definitions in the screenshot.=
&nbsp;</div><div>I think you need to add =E2=80=9Cmembership=E2=80=9D to you=
r pgadmin connection string</div></div></body></html>=

--Apple-Mail-EA94AC4D-7B7C-4ED8-AED4-05449921B0FA--