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

Поиск
Список
Период
Сортировка
От Karen Goh
Тема Re: How do I enabled Windows 10 to be able to run PSQL etc
Дата
Msg-id 1105744936.4152325.1568285419687@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: How do I enabled Windows 10 to be able to run PSQL etc  (Steve Midgley <science@misuse.org>)
Ответы Re: How do I enabled Windows 10 to be able to run PSQL etc
Список pgsql-sql

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

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 need to put a idenity as ALWAYS and increment by 1 ?

cos another table I had used pgAdmin4 to define it as identity, ALWAYS, increment 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

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 <science@misuse.org> wrote:




On Mon, Sep 9, 2019 at 6:07 AM Karen Goh <karenworld@yahoo.com> wrote:
Hi Rob,

I refer to your comment -
I think you need to add “membership” to your pgadmin connection 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 there 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 impressive 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 and Pg 11 Server is broken in some ways. If I were taking over the keyboard at your workstation and had a critical deadline for tomorrow, here are some steps I would take:
  • Dump my databases, if I can
  • 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
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 in your database? (Postgres treats schemas in much the same way that other database 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 for that time frame..

Steve

В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Find and replace
Следующее
От: Steve Midgley
Дата:
Сообщение: Re: How do I enabled Windows 10 to be able to run PSQL etc