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

Karen Goh <[email protected]> Thu, 12 Sep 2019 10:50:19 +0000 (UTC)
Newsgroups gmane.comp.db.postgresql.sql
Message-ID <[email protected]>
------=_Part_4152324_430930693.1568285419685
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=20
Hi Steve,

What I did was I manually created the table and then pgAdmin4 then allowed =
me to use a script to insert the columns !

Anyway, now my problem is that i get a=20

org.postgresql.util.PSQLException: ERROR: null value in column "parent_id" =
violates not-null constraint

I'd like to know since I have already made parent_id a primary key, do I ne=
ed to put a idenity as ALWAYS and increment by 1 ?

cos another table I had used pgAdmin4 to define it as identity, ALWAYS, inc=
rement 1 and it works well....

so what is the difference between identity and PRIMARY KEY ?

and if I follow the other table definition for id and put in the ALWAYS, it=
 will give me another problem...that the generated_id doesn't get inserted =
even though it should not=20

Another problem is that I found most 'developers' are using psql and don't =
know what I am talking when relating PGAdmin4 problem but I just can't get =
PSQL to work...
     On Monday, September 9, 2019, 11:08:18 PM GMT+8, Steve Midgley <scienc=
[email protected]> wrote: =20
=20
=20

On Mon, Sep 9, 2019 at 6:07 AM Karen Goh <[email protected]> wrote:

 Hi Rob,

I refer to your comment -
I think you need to add =E2=80=9Cmembership=E2=80=9D to your pgadmin connec=
tion string.

How do I add in the pgadmin connection string at pgAdmin4 ?

Before that, I was creating table using the sql script in version 10 and th=
ere was no problem at all.

So, it really baffled me it is not working out this time.

And tomorrow I have an important demo and it seems that I have to take out =
this table in my app to show...which will be less impressive in a not so im=
pressive app that i have created ....:(

I have made some more screenshots which shows some more error when I tried =
to retrieve the table under the table postgres which is already created not=
 it is not showing the table.

Please help,


Your second screenshot seems to indicate your connection between PgAdmin an=
d Pg 11 Server is broken in some ways. If I were taking over the keyboard a=
t your workstation and had a critical deadline for tomorrow, here are some =
steps I would take:  =20
   - Dump my databases, if I can  =20

   - Backup whatever work I have on a usb stick (create sql files, etc)
   - Uninstall Pg Server and Pg Admin
   - Reinstall and see if things start working better
Then on more detailed level, my understanding of Postgres is that when you =
prefix a word in front of a table you are referring to a schema so=20
create table membership.parents...
Will never work unless you first create the schema that parents sit within:=
create schema membership
Is it possible your problem is that you aren't creating membership schema i=
n your database? (Postgres treats schemas in much the same way that other d=
atabase engines treat actual databases).
Finally, if you are desperate for a working Pg SQL server over the next 24 =
hours consider spinning up an AWS RDS Pg instance and connecting PgAdmin to=
 that - that way you know the database is reliable and correctly configured=
 for sure. There might even be a "free tier" that gives you free service fo=
r that time frame..

Steve
 =20
------=_Part_4152324_430930693.1568285419685
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div>                <br>Hi Steve,<br><br>What I did was I manually created=
 the table and then pgAdmin4 then allowed me to use a script to insert the =
columns !<br><br>Anyway, now my problem is that i get a <br><br>org.postgre=
sql.util.PSQLException: ERROR: null value in column &quot;parent_id&quot; v=
iolates not-null constraint<br><br>I&#39;d like to know since I have alread=
y made parent_id a primary key, do I need to put a idenity as ALWAYS and in=
crement by 1 ?<br><br>cos another table I had used pgAdmin4 to define it as=
 identity, ALWAYS, increment 1 and it works well....<br><br>so what is the =
difference between identity and PRIMARY KEY ?<br><br>and if I follow the ot=
her table definition for id and put in the ALWAYS, it will give me another =
problem...that the generated_id doesn&#39;t get inserted even though it sho=
uld not <br><br>Another problem is that I found most &#39;developers&#39; a=
re using psql and don&#39;t know what I am talking when relating PGAdmin4 p=
roblem but I just can&#39;t get PSQL to work...<br>            </div>      =
      <div class=3D"yahoo_quoted" style=3D"margin:10px 0px 0px 0.8ex;border=
-left:1px solid #ccc;padding-left:1ex;">                        <div style=
=3D"font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13=
px;color:#26282a;">                                <div>                   =
 On Monday, September 9, 2019, 11:08:18 PM GMT+8, Steve Midgley &lt;science=
@misuse.org&gt; wrote:                </div>                <div><br></div>=
                <div><br></div>                <div><div id=3D"yiv411980822=
9"><div><div dir=3D"ltr"><div dir=3D"ltr"><br clear=3D"none"></div><br clea=
r=3D"none"><div class=3D"yiv4119808229gmail_quote"><div class=3D"yiv4119808=
229yqt8248914005" id=3D"yiv4119808229yqtfd64714"><div class=3D"yiv411980822=
9gmail_attr" dir=3D"ltr">On Mon, Sep 9, 2019 at 6:07 AM Karen Goh &lt;<a re=
l=3D"nofollow" shape=3D"rect" ymailto=3D"mailto:[email protected]" targe=
t=3D"_blank" href=3D"mailto:[email protected]">[email protected]</a>&=
gt; wrote:<br clear=3D"none"></div></div><blockquote class=3D"yiv4119808229=
gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20=
4,204,204);padding-left:1ex;"><div><div class=3D"yiv4119808229yqt8248914005=
" id=3D"yiv4119808229yqtfd72092">                 Hi Rob,<br clear=3D"none"=
><br clear=3D"none">I refer to your comment -<br clear=3D"none">I think you=
 need to add =E2=80=9Cmembership=E2=80=9D to your pgadmin connection string=
.<br clear=3D"none"><br clear=3D"none">How do I add in the pgadmin connecti=
on string at pgAdmin4 ?<br clear=3D"none"><br clear=3D"none">Before that, I=
 was creating table using the sql script in version 10 and there was no pro=
blem at all.<br clear=3D"none"><br clear=3D"none">So, it really baffled me =
it is not working out this time.<br clear=3D"none"><br clear=3D"none">And t=
omorrow I have an important demo and it seems that I have to take out this =
table in my app to show...which will be less impressive in a not so impress=
ive app that i have created ....:(<br clear=3D"none"><br clear=3D"none">I h=
ave made some more screenshots which shows some more error when I tried to =
retrieve the table under the table postgres which is already created not it=
 is not showing the table.<br clear=3D"none"><br clear=3D"none">Please help=
,</div><br clear=3D"none"></div></blockquote><div><br clear=3D"none"></div>=
<div>Your second screenshot seems to indicate your connection between PgAdm=
in and Pg 11 Server is broken in some ways. If I were taking over the keybo=
ard at your workstation and had a critical deadline for tomorrow, here are =
some steps I would take:</div><div><ul><li>Dump my databases, if I can<br c=
lear=3D"none"></li><li>Backup whatever work I have on a usb stick (create s=
ql files, etc)</li><li>Uninstall Pg Server and Pg Admin</li><li>Reinstall a=
nd see if things start working better</li></ul><div>Then on more detailed l=
evel, my understanding of Postgres is that when you prefix a word in front =
of a table you are referring to a schema so <br clear=3D"none"></div><div s=
tyle=3D"margin-left:40px;">create table membership.parents...</div><br clea=
r=3D"none"></div><div>Will never work unless you first <a rel=3D"nofollow" =
shape=3D"rect" target=3D"_blank" href=3D"https://www.postgresql.org/docs/cu=
rrent/sql-createschema.html">create the schema </a>that parents sit within:=
</div><div style=3D"margin-left:40px;">create schema membership</div></div>=
<div class=3D"yiv4119808229gmail_quote"><br clear=3D"none"></div><div class=
=3D"yiv4119808229gmail_quote">Is it possible your problem is that you aren'=
t creating membership schema in your database? (Postgres treats schemas in =
much the same way that other database engines treat actual databases).</div=
><div class=3D"yiv4119808229gmail_quote"><br clear=3D"none"></div><div clas=
s=3D"yiv4119808229gmail_quote">Finally, if you are desperate for a working =
Pg SQL server over the next 24 hours consider spinning up an AWS RDS Pg ins=
tance and connecting PgAdmin to that - that way you know the database is re=
liable and correctly configured for sure. There might even be a "free tier"=
 that gives you free service for that time frame..<br clear=3D"none"></div>=
<div class=3D"yiv4119808229gmail_quote"><br clear=3D"none"></div><div class=
=3D"yiv4119808229gmail_quote">Steve</div><div class=3D"yiv4119808229yqt8248=
914005" id=3D"yiv4119808229yqtfd16241"><div class=3D"yiv4119808229gmail_quo=
te"><br clear=3D"none"></div></div></div></div></div></div>            </di=
v>                </div>
------=_Part_4152324_430930693.1568285419685--