Thread: Default value after table create
With set default value, after table create ?
with pgAdmin II , psql, or etc...
Regards,
Robson
Hi.
alter table <table_name> alter column <column_name> add default <default>;
Cheers,
Florian
Florian
-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Robson
Sent: Friday, June 21, 2002 2:13 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Default value after table create
Importance: HighWith set default value, after table create ?with pgAdmin II , psql, or etc...Regards,Robson
Hi ! I have a httpd server on one server, and PostgresQL 7.2 on a second server (P4 1.7 Ghz / Linux ) on a local network. When there are about 20 (and more ) connection on the DB, the remote connecxtion to the DB from the web server is very long (about 5-10 sec) before have the prompt. On the local machine, it's near immediate. I use IP authentification (no username/password). Local network seems ok (I can connect to web sites etc..fast !) Any clue ?? Thank you for your help ! jean-arthur
Jean-Arthur Silve <jeanarthur@eurovox.fr> writes: > I have a httpd server on one server, and PostgresQL 7.2 on a second server > (P4 1.7 Ghz / Linux ) on a local network. > When there are about 20 (and more ) connection on the DB, the remote > connecxtion to the DB from the web server is very long (about 5-10 sec) > before have the prompt. > On the local machine, it's near immediate. Weird. Perhaps something wrong with your DNS setup, causing it to take a long time to resolve the name of the other machine? Anyway I'd suspect that the problem is not within Postgres proper, given that you're not seeing a performance problem with local connections. Another thing you might try just to obtain more data is to test local connections that use TCP rather than Unix-socket transport, eg psql -h 127.0.0.1 > I use IP authentification (no username/password). You mean "trust"? Please describe your pg_hba contents *exactly*; this might be a relevant difference ... regards, tom lane
Well... I tried to connect with psql -h 127.0.0.1 mydb and it's slow (+/- 5 sec.) and psql mydb is fast ( less than 1 sec.) ! Here is my pg_hba : .. few comments... local all trust host all 127.0.0.1 255.255.255.255 trust host all my_ip 255.255.255.255 trust where my_ip is an IP address May be I have a probleme with my system ? version of the kernel is 2.4 jean-arthur At 18:55 24/06/02 -0400, Tom Lane wrote: >Jean-Arthur Silve <jeanarthur@eurovox.fr> writes: > > I have a httpd server on one server, and PostgresQL 7.2 on a second server > > (P4 1.7 Ghz / Linux ) on a local network. > > > When there are about 20 (and more ) connection on the DB, the remote > > connecxtion to the DB from the web server is very long (about 5-10 sec) > > before have the prompt. > > > On the local machine, it's near immediate. > >Weird. Perhaps something wrong with your DNS setup, causing it to take >a long time to resolve the name of the other machine? Anyway I'd >suspect that the problem is not within Postgres proper, given that >you're not seeing a performance problem with local connections. > >Another thing you might try just to obtain more data is to test local >connections that use TCP rather than Unix-socket transport, eg > psql -h 127.0.0.1 > > > I use IP authentification (no username/password). > >You mean "trust"? Please describe your pg_hba contents *exactly*; >this might be a relevant difference ... > > regards, tom lane
Jean-Arthur Silve <jeanarthur@eurovox.fr> writes: > I tried to connect with psql -h 127.0.0.1 mydb and it's slow (+/- 5 sec.) > and psql mydb is fast ( less than 1 sec.) ! > Here is my pg_hba : > local all trust > host all 127.0.0.1 255.255.255.255 trust > host all my_ip 255.255.255.255 trust Weird. You're using trust in both cases, so there's no reason for authentication to make any difference. The only thing I can think of is that something is wrong with DNS name resolution. Do you have hostname_lookup enabled in postgresql.conf? Does changing it to the other setting make any difference? (Don't forget to SIGHUP the postmaster after changing postgresql.conf, else it won't notice.) regards, tom lane