Re: [SQL] [ADMIN] Postgres schema comparison.
|-Original Message- |From: Goulet, Dick [mailto:[EMAIL PROTECTED] |Sent: Montag, 07. März 2005 16:33 |To: John DeSoi; Stef |Cc: pgsql-ADMIN@postgresql.org; pgsql-sql@postgresql.org |Subject: Re: [SQL] [ADMIN] Postgres schema comparison. | | | My favorite for this task is WinSql available from |http://www.synametrics.com/SynametricsWebApp/WinSQL.jsp. It |can compare |the structure and content of the two tables. And will it also generate DIFF-SQL-Scripts to make a target-DB look like a MasterDB? Do you know? How about Structural Changes as adding a column? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [ADMIN] Too many clients----A big problem for my team
I had the same problem a few weeks ago. Was happening that our developers using Tomcat, were using connection pools, and stoping and restarting their aplications which causes to leave these connection opened and opening some new. Look in the servlet engine (or what they use) for the number of connections they made (in Tomcat it's a parameter), say them not to leave the connections opened, and not to stop and restart the java application when they make changes, they must restart the "engine" (it closes all the opened connections). It worked for me ... ganapatiram wrote: Hi Experts, I work with postgresql 8.0 version. I have a team of 14 developers. When all the team connects the DB i see this error very very frequently which is a severe problem for me and team all the day. The error is: *Please report this exception: java.sql.SQLException: FATAL: sorry, too many clients already* ** *when i do trial and error changes i see this error differently but the essense of the error remains same. * ** **I have max_connections=200 and i have 5 users for my DB. I dont understand what to do in order to resolve this. Please suggest me something by which i can overcome this problem. I referred few threads but none of them are of my case. Waiting for your valuable suggestion.. Thanks and Regards Ram -- Daniel Rubio Rodríguez OASI (Organisme Autònom Per la Societat de la Informació) c/ Assalt, 12 43003 - Tarragona Tef.: 977.244.007 - Fax: 977.224.517 e-mail: drubio a oasi.org ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[ADMIN] Slow Update
Hi everydoby! I have a table with more than 26000 rows and I need to use update a column of this tables on all lines according with a column. So, I need to use update 26000 times correct? I tried to use a this command: "UPDATE database SET column1=0 WHERE column2 in (VARIABLES)", where VARIABLES is the list separeted by commas. But the list has about 26000 entries, so I got a message of too long parameters. Is there a way to use UPDATE pushing values from a file? Is there a way to run update more faster? It is taking about 10 seconds for each UPDATE... Does anyone knows another form to do this task? Thanks - Original Message - From: "Daniel Rubio" <[EMAIL PROTECTED]> To: Sent: Wednesday, March 09, 2005 8:33 AM Subject: Re: [ADMIN] Too many clientsA big problem for my team > I had the same problem a few weeks ago. > > Was happening that our developers using Tomcat, were using connection > pools, and stoping and restarting their aplications which causes to > leave these connection opened and opening some new. > > Look in the servlet engine (or what they use) for the number of > connections they made (in Tomcat it's a parameter), say them not to > leave the connections opened, and not to stop and restart the java > application when they make changes, they must restart the "engine" (it > closes all the opened connections). > > It worked for me ... > > ganapatiram wrote: > > > Hi Experts, > > > >I work with postgresql 8.0 version. I have a team of 14 > > developers. When all the team connects the DB i see this error very very > > frequently which is a severe problem for me and team all the day. The > > error is: > > > > > > *Please report this exception: java.sql.SQLException: FATAL: sorry, too > > many clients already* > > > > ** > > > > *when i do trial and error changes i see this error differently but the > > essense of the error remains same. * > > > > ** > > > > **I have max_connections=200 and i have 5 users for my DB. I > > dont understand what to do in order to resolve this. Please suggest me > > something by which i can overcome this problem. I referred few threads > > but none of them are of my case. > > > > > > > > > > > > Waiting for your valuable suggestion.. > > > > > > > > > > > > > > > > > > > > Thanks and Regards > > > > Ram > > > > > -- > > Daniel Rubio Rodríguez > OASI (Organisme Autònom Per la Societat de la Informació) > c/ Assalt, 12 > 43003 - Tarragona > Tef.: 977.244.007 - Fax: 977.224.517 > e-mail: drubio a oasi.org > > > > ---(end of broadcast)--- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [ADMIN] Table Partitioning
Ken, Table partitioning doesn't really exist, to the best of my knowledge, but tablespaces, which are new to 8.0, allow for partitioning of data (individual tables, indexes) across multiple locations on disk. See http://www.postgresql.org/docs/8.0/static/sql-createtablespace.html -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC http://www.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-260-0005 On Mar 3, 2005, at 3:56 PM, Ken Reid wrote: I am new to postgres and was wondering if table partitioning is supported in Postgres. And if so what version and where can I find documentation on it. - Thank You - Ken Reid ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [ADMIN] Slow Update
On Wed, Mar 09, 2005 at 11:44:33 -0300, Ricardo Valença de Assis <[EMAIL PROTECTED]> wrote: > Hi everydoby! > > I have a table with more than 26000 rows and I need to use update a > column of this tables on all lines according with a column. So, I need to > use update 26000 times correct? I tried to use a this command: > "UPDATE database SET column1=0 WHERE column2 in (VARIABLES)", where > VARIABLES is the list separeted by commas. But the list has about 26000 > entries, so I got a message of too long parameters. Is there a way to use > UPDATE pushing values from a file? Is there a way to run update more faster? > It is taking about 10 seconds for each UPDATE... Does anyone knows another > form to do this task? If you really want to do this for all rows in the table just do: UPDATE tablename SET column1=0; > > - Original Message - > From: "Daniel Rubio" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, March 09, 2005 8:33 AM > Subject: Re: [ADMIN] Too many clientsA big problem for my team Why did you include this message that had nothing to do with your question? ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[ADMIN] Tablespace On 8.0 (Windows)
How tablespaces are implemented in Windows if there's no symbolic links? Thanks. ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [ADMIN] [SQL] [SOLVED] Postgres schema comparison.
Hi all, If anyone is interested, here's the final solution that I'm using to build a list of tables and their md5sums based on what the psql interface queries when you do '\d [TABLE NAME]' I attached the function I created, and this is the SQL I run : select relname||':'||get_table_checksum(relname) from pg_class where relkind = 'r' and relname not like ('pg_%') and relname not like ('sql_%') order by relname; This gives the same result for a specific table across all versions of postgres >= 7.3, and runs for a minute or so for +- 450 tables on my machine. It may break if you have some exotic definitions that I didn't test for, but I think it's pretty solid as it is here. Kind Regards Stefan Stef mentioned : => Here's my final solution that runs in less than a minute for +- 543 tables : => for x in $(psql -tc "select relname from pg_class where relkind = 'r' and relname not like 'pg_%'") => do =>echo "$(psql -tc "select encode(digest('$(psql -c '\d '${x}'' mer9188_test | tr -d \"\'\")', 'md5'), 'hex')" mer9188_test | grep -v "^$"|tr -d " "):${x}" => done > compare_list.lst get_table_checksum.sql Description: Binary data ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [ADMIN] Tablespace On 8.0 (Windows)
> How tablespaces are implemented in Windows if there's no > symbolic links? It uses NTFS Junctions, which is bscailly symbolic links for directories. //Magnus ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
[ADMIN] Functions and transactions
Here is my problem. I have a function that is triggered on insert. For simplicity's sake, lets say the function looks like this: CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS ' DECLARE lockrows RECORD; BEGIN select into lockrows * from table1 where pkey_id = NEW.pkey_id for update on table1; update table1 set active = false where NEW.pkey_id = pkey_id and active; NEW.active := true; END; 'language 'plpgsql'; I have two inserts, lets say insert A and insert B. A new explicit transaction block is started with the intent of executing insert A. begin; insert into table1 (stuff) VALUES (morestuff); At this time another terminal is opened up and insert B is executed in the same fasion: begin; insert into table1 (stuff) VALUES (different_more_stuff); In my two open terminals insert A has completed and insert B is waiting for insert A's transaction to be committed, before it can move on. I commit insert A and check to see how many active row's I have for that ID (there should be 1, the new row). commit; select * from table1; I find that there is one active row. Everything is fine at this point. Now, I commit insert B, that has just finished, because insert A has been committed. I expect to see 1 active row, because the update contained in the function has not been executed, and has therefore not grabbed a snapshot of the table yet. I expect that the new row from insert A will be updated as well. commit; select * from table1; To my surprise, I see 2 active rows. What i'm assuming is happening with the transaction must be flawed. Does the function handle a transaction outside of the one the insert is using? Just trying to figure out what exactly is going on and why. Thanks in advance for the insight. If it would be easier to understand by having me paste what is happening directly from the terminals, let me know. Kris ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [ADMIN] Slow Update
If it is necessary for you to comapre each row with a list of 26 possible values (VARIABLES) in the IN clause and not do a replacement of all values in column1 with "0" as suggested previously, you might want to place the 26000 variables in a temporary table that is either sorted physically in the required search order, or indexed, then place a select on the IN clause from that table. I'm not surprised it's taking a long time to run the update. Firstly, it's an update, and secondly, for each of the 26000 rows in the table, it is comparing with 26000 variables, so it is doing 26000 x 26000 "selects". Adrian ICQ 120480893 https://www.paypal.com/refer/pal=N6T2FQ7WRPHH4From: Bruno Wolff III <[EMAIL PROTECTED]> To: Ricardo Valença de Assis <[EMAIL PROTECTED]> CC: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Slow Update Date: Wed, 9 Mar 2005 09:19:18 -0600 On Wed, Mar 09, 2005 at 11:44:33 -0300, Ricardo Valença de Assis <[EMAIL PROTECTED]> wrote: > Hi everydoby! > > I have a table with more than 26000 rows and I need to use update a > column of this tables on all lines according with a column. So, I need to > use update 26000 times correct? I tried to use a this command: > "UPDATE database SET column1=0 WHERE column2 in (VARIABLES)", where > VARIABLES is the list separeted by commas. But the list has about 26000 > entries, so I got a message of too long parameters. Is there a way to use > UPDATE pushing values from a file? Is there a way to run update more faster? > It is taking about 10 seconds for each UPDATE... Does anyone knows another > form to do this task? If you really want to do this for all rows in the table just do: UPDATE tablename SET column1=0; > > - Original Message - > From: "Daniel Rubio" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, March 09, 2005 8:33 AM > Subject: Re: [ADMIN] Too many clientsA big problem for my team Why did you include this message that had nothing to do with your question? ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] Looking for love? Check out XtraMSN Personals
Re: [ADMIN] Functions and transactions
What transaction level are you using? Evgeny. Kris Kiger wrote: Here is my problem. I have a function that is triggered on insert. For simplicity's sake, lets say the function looks like this: CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS ' DECLARE lockrows RECORD; BEGIN select into lockrows * from table1 where pkey_id = NEW.pkey_id for update on table1; update table1 set active = false where NEW.pkey_id = pkey_id and active; NEW.active := true; END; 'language 'plpgsql'; I have two inserts, lets say insert A and insert B. A new explicit transaction block is started with the intent of executing insert A. begin; insert into table1 (stuff) VALUES (morestuff); At this time another terminal is opened up and insert B is executed in the same fasion: begin; insert into table1 (stuff) VALUES (different_more_stuff); In my two open terminals insert A has completed and insert B is waiting for insert A's transaction to be committed, before it can move on. I commit insert A and check to see how many active row's I have for that ID (there should be 1, the new row). commit; select * from table1; I find that there is one active row. Everything is fine at this point. Now, I commit insert B, that has just finished, because insert A has been committed. I expect to see 1 active row, because the update contained in the function has not been executed, and has therefore not grabbed a snapshot of the table yet. I expect that the new row from insert A will be updated as well. commit; select * from table1; To my surprise, I see 2 active rows. What i'm assuming is happening with the transaction must be flawed. Does the function handle a transaction outside of the one the insert is using? Just trying to figure out what exactly is going on and why. Thanks in advance for the insight. If it would be easier to understand by having me paste what is happening directly from the terminals, let me know. Kris ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [ADMIN] Functions and transactions
transaction_isolation --- read committed Running Postgres 7.4 btw Kris Tsirkin Evgeny wrote: What transaction level are you using? Evgeny. Kris Kiger wrote: Here is my problem. I have a function that is triggered on insert. For simplicity's sake, lets say the function looks like this: CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS ' DECLARE lockrows RECORD; BEGIN select into lockrows * from table1 where pkey_id = NEW.pkey_id for update on table1; update table1 set active = false where NEW.pkey_id = pkey_id and active; NEW.active := true; END; 'language 'plpgsql'; I have two inserts, lets say insert A and insert B. A new explicit transaction block is started with the intent of executing insert A. begin; insert into table1 (stuff) VALUES (morestuff); At this time another terminal is opened up and insert B is executed in the same fasion: begin; insert into table1 (stuff) VALUES (different_more_stuff); In my two open terminals insert A has completed and insert B is waiting for insert A's transaction to be committed, before it can move on. I commit insert A and check to see how many active row's I have for that ID (there should be 1, the new row). commit; select * from table1; I find that there is one active row. Everything is fine at this point. Now, I commit insert B, that has just finished, because insert A has been committed. I expect to see 1 active row, because the update contained in the function has not been executed, and has therefore not grabbed a snapshot of the table yet. I expect that the new row from insert A will be updated as well. commit; select * from table1; To my surprise, I see 2 active rows. What i'm assuming is happening with the transaction must be flawed. Does the function handle a transaction outside of the one the insert is using? Just trying to figure out what exactly is going on and why. Thanks in advance for the insight. If it would be easier to understand by having me paste what is happening directly from the terminals, let me know. Kris ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
[ADMIN] readline ?
hi all please help me... I am trying to instal PostgreSQL 7.4.6 and when I run the command ./configure, I get the error... configure: error: readline library not found Please help ... !!! regards Gaurav Arora __ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [ADMIN] readline ?
On Wed, 2005-03-09 at 15:14, Gaurav Arora wrote: > hi all > > please help me... I am trying to instal > PostgreSQL 7.4.6 and when I run the command > ./configure, I get the error... > > configure: error: readline library not found > > Please help ... !!! assuming you're on an rpm based system, look for the readline-devel rpm package and install it. Same a go for a few other packages, like zlib-devel. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [ADMIN] readline ?
On Mar 9, 2005, at 4:24 PM, Scott Marlowe wrote: assuming you're on an rpm based system, look for the readline-devel rpm package and install it. Same a go for a few other packages, like zlib-devel. And if not and you don't need readline just use ./configure --without-readline John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [ADMIN] Functions and transactions
I guess first we should understand why the insert B waits at all,the insert A did not commit ,right ,then how did it found any pkey_id = NEW.pkey_id? That means you have already had those while starting your experiment. So ,insert B wait for those "old" rows not for your insert (i mean an INSERT) to commit.Once the A function commits the old rows are released but the INSERT is not yet done!it will take place only now when the trigger of A is done. This means that you have transaction in a wrong place - place it around the insert not inside the trigger and commit AFTER the insert . All this is an assumption only ,not realy sure if i am right. Evgeny Kris Kiger wrote: transaction_isolation --- read committed Running Postgres 7.4 btw Kris Tsirkin Evgeny wrote: What transaction level are you using? Evgeny. Kris Kiger wrote: Here is my problem. I have a function that is triggered on insert. For simplicity's sake, lets say the function looks like this: CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS ' DECLARE lockrows RECORD; BEGIN select into lockrows * from table1 where pkey_id = NEW.pkey_id for update on table1; update table1 set active = false where NEW.pkey_id = pkey_id and active; NEW.active := true; END; 'language 'plpgsql'; I have two inserts, lets say insert A and insert B. A new explicit transaction block is started with the intent of executing insert A. begin; insert into table1 (stuff) VALUES (morestuff); At this time another terminal is opened up and insert B is executed in the same fasion: begin; insert into table1 (stuff) VALUES (different_more_stuff); In my two open terminals insert A has completed and insert B is waiting for insert A's transaction to be committed, before it can move on. I commit insert A and check to see how many active row's I have for that ID (there should be 1, the new row). commit; select * from table1; I find that there is one active row. Everything is fine at this point. Now, I commit insert B, that has just finished, because insert A has been committed. I expect to see 1 active row, because the update contained in the function has not been executed, and has therefore not grabbed a snapshot of the table yet. I expect that the new row from insert A will be updated as well. commit; select * from table1; To my surprise, I see 2 active rows. What i'm assuming is happening with the transaction must be flawed. Does the function handle a transaction outside of the one the insert is using? Just trying to figure out what exactly is going on and why. Thanks in advance for the insight. If it would be easier to understand by having me paste what is happening directly from the terminals, let me know. Kris ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [ADMIN] Functions and transactions
Kris Kiger <[EMAIL PROTECTED]> writes: > Here is my problem. I have a function that is triggered on insert. For > simplicity's sake, lets say the function looks like this: > CREATE OR REPLACE FUNCTION dostuff_on_insert() RETURNS TRIGGER AS ' > DECLARE lockrows RECORD; > BEGIN > select into lockrows * from table1 where pkey_id = NEW.pkey_id for > update on table1; > update table1 set active = false where NEW.pkey_id = pkey_id and active; > NEW.active := true; > END; > 'language 'plpgsql'; This is awfully vague. What table is the trigger placed on? (If table1 itself, seems like there are more efficient ways to do this.) What events is the trigger fired for, and is it BEFORE or AFTER? regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
[ADMIN] Schemas to Search_path
Title: Schemas to Search_path I was playing around with schemas today to understand how it would fit in our application design. I couldn't understand why I got to set search_path to schema name everytime I login to psql. This is what I did. -ceated a user "foo" with createdb privilege as psql -d template1 -created db "foodb" with encoding = unicode as psql -d template1 -U foo -- this makes foo as the owner of the db. -create schema "foo_schema" with authorization to foo user as psql -d foodb -U foo -dropped public schema as I don't want others or foo user to create objects in public schema. I did this via psql -d foodb -U postgres -- since postgres being the owner of public schema I had to login as superuser postgres. Now comes the fun part I logged into foodb as foo user and tried to create a table. Bang! ERROR: no schema has been selected to create in. search_path had $user, public the default ones, shouldn't the table get created in user's authorized schema. Perhaps, I'm trying to compare with oracle users/schemas. However, when set search path to foo_schema then table gets created fine. Also, whenever I login, how should make \dt to just show the objects under the user's authorized schema without setting search path everytime. Thanks Stalin
Re: [ADMIN] Schemas to Search_path
"Subbiah, Stalin" <[EMAIL PROTECTED]> writes: > I logged into foodb as foo user and tried to create a table. Bang! > ERROR: no schema has been selected to create in. search_path had $user, > public the default ones, shouldn't the table get created in user's > authorized schema. Which one? Now, if you make the schema name the same as the user name, it will do what you want --- that's what the $user is for. If you want some other schema that happens to belong to that user to be the default, you have to adjust the normal value of search_path. (See ALTER USER SET if you'd like that adjustment to be done for you automatically at each login.) regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [ADMIN] Schemas to Search_path
I created schema name "foo_schema" different from user name "foo". However, when I created the schema, I had specified authorization set to foo user. Does that mean, if the owner of the schema and schema name are different, then only way, is to set through alter user set or search path correct ? Thanks Much! -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 09, 2005 4:57 PM To: Subbiah, Stalin Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Schemas to Search_path "Subbiah, Stalin" <[EMAIL PROTECTED]> writes: > I logged into foodb as foo user and tried to create a table. Bang! > ERROR: no schema has been selected to create in. search_path had > $user, public the default ones, shouldn't the table get created in > user's authorized schema. Which one? Now, if you make the schema name the same as the user name, it will do what you want --- that's what the $user is for. If you want some other schema that happens to belong to that user to be the default, you have to adjust the normal value of search_path. (See ALTER USER SET if you'd like that adjustment to be done for you automatically at each login.) regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [ADMIN] Visual data model creation / maintenance tools
> I am interested in what people here think are good tools (free or not) for > creating / maintaining a pg data model. A layout view for relationships is P.S. If you are interested in only the layout view of relationship and not designing, a trivial, despised but useful one is M$ Access. (Sorry for the guard-up.) You can link tables from Postgresql using odbc and manually create relationships. It's easier to handle and print than most of the serious tools. (In fact, I find Access better when there are some (~30) tables.) There's also postgresql-autodoc which is supposed to create the relationship diagram from Postgresql database along with documentation. The documentation is very nice, but the relationship graphic (for use with AT&T viz package) gets kind of messed up. www.embarcadero.com has Dbartisan which is commercial and OK. These are what I tried myself, but I know there are many, many of ERD tools. Regards, Ben Kim Database Developer/Systems Administrator 434E Harrington Tower / College of Education Texas A&M University ---(end of broadcast)--- TIP 8: explain analyze is your friend
[ADMIN] template1 database
Hi list, I've recently started using PgSQL and i must say it gose quite good as far as i can say. Just been wondering how important is template1 database to PgSQL? What would happen if i drop this database together with postgres user. -- Eimantas VaiÄiÅnas VU SkaiÄiavimo centras ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [ADMIN] template1 database
Eimantas =?utf-8?q?Vai=C4=8Di=C5=ABnas?= <[EMAIL PROTECTED]> writes: > Just been wondering how important is template1 database to PgSQL? The database server itself doesn't care, but there are enough client-side tools that assume template1 exists that you would not find life pleasant if you do this. > What would happen if i drop this database together with postgres user. The root user does not have to be named "postgres", but you do have to have a root user. What exactly do you think will be accomplished by removing the postgres user? If you are just idly searching for ways to break your database, try removing some of the builtin datatypes from pg_type, or builtin functions from pg_proc, etc ... regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [ADMIN] template1 database
On Thu, Mar 10, 2005 at 08:17:03AM +, Eimantas Vai??i??nas wrote: > I've recently started using PgSQL and i must say it gose quite good as far as > i can say. Just been wondering how important is template1 database to PgSQL? > What would happen if i drop this database together with postgres user. See "Template Databases" in the "Managing Databases" chapter of the documentation, as well as the "Database Users and Privileges" chapter: http://www.postgresql.org/docs/8.0/interactive/manage-ag-templatedbs.html http://www.postgresql.org/docs/8.0/interactive/user-manag.html Is there a reason you're thinking about dropping template1 and the postgres user? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq