Thursday, October 28, 2010

Can U Use Heating Pad On Back For Hsv

date: Admission to the database without

The user of a postgres database can wish to access the database engine without having to enter the key.
To achieve this we must create the file ". Pgpass" in the user's home directory you want to enter without the password.
The file should contain lines with the following format.
  • hostname: port: database: username: password
fields in the file described contain the following information:
  • hostname -> type "localhost" if the database is in the same team, should be on another team enter the ip or name of the computer on the network.
  • port -> you must enter the port number for connection to postgres, default port postgres connection is "5432."
  • database -> you must write the name of the database to which you wish to enter.
  • username -> you must type the user name with which you want to access the database.
  • password -> you must enter the password used by the user to access the database.
This file must have strict permissions to read and write only to the user and no permissions for group or others. To check the file permissions can run the following command.
  • ls-la. Pgpass
This delivers the following line in response.
  • -rw ------- 1 username groupname fechamodificacion size. Pgpass
If no file permissions are as shown in the previous line, use the following command to change file permissions.
  • chmod 600. Pgpass
"Thank you for sharing your knowledge"

Wednesday, October 27, 2010

Wordings For Puberty Invitation

key PostgreSQL result of a SELECT Copy a file

There are times when it is desirable to pass the results of a select a file, postgres allows you to perform this operation. For this you must run the following command at the console of postgres.
  • postgres = # copy (select * from table_name) to 'directorio_name / file_name',
This lets you copy all data from the select the file in the selected directory. To make it more clear you can see the following example which is executed in postgres console on a computer with Linux installed.
  • postgres = # copy (select * from students) to '/ tmp / data.txt';

IMPORTANT:
is important to remember some postgres commands that allow assistance.
  • postgres = # \\ h => can get help from the postgres commands.
  • postgres = # \\ help command => can get help from a postgres specific command.
  • postgres = # \\? => Can get help from the postgres client commands. Before concluding
I should clarify that "postgres = #" indicates that the command is executed in postgres console.

"Thank you for sharing your knowledge"

Tuesday, October 26, 2010

18 Is On The Right Palm

PostgreSQL entry modes, user creation and

After installing PostgreSQL on a machine with Ubuntu, you must enter the system with a user and a database engine available in the database, for this can be used the following command.
  • -u user sudo psql dbname
As user to use postgres as postgres database, this will allow the user to access the database engine without a key rather than the root.

Once you have entered a user must be created to work with databases, this can be done with this command.
  • CREATE USER "user" CREATEDB CREATEUSER WITH PASSWORD 'password'
As a user must enter user name and password will be created and the key to user input, such as a user to create the same php must write the following.
  • CREATE USER "www-data" CREATEDB CREATEUSER WITH PASSWORD 'www-data'
To create a database owned by the user who has created you must use the command written below.
  • CREATE DATABASE db_name WITH OWNER = "user"
Once the user and the database has been created it can enter the following command PostgreSQL.
  • psql-h localhost-U username databasename
Then the motor requests to the user entered password in the process of creation. Now you can perform all you want with the database you just created.

"Thank you for sharing your knowledge"

Monday, October 25, 2010

Messages On New Arrival

PostgreSQL database: Sequence Control

In PostgreSQL you can create tables with "primary key" autoincremented, as I observed in the following example.

create table students (id SERIAL not null
,
name varchar (255) NULL, constraint
pk_beneficios primary key (id));


autoincremented This will create a sequence for the "primary key" as shown below.

id integer not null default nextval ('alumnos_id_seq':: regclass)

Some times it is necessary to observe or modify the sequence to perform these operations can be Use the following sentences.

  • "SELECT FROM last_value nombre_secuencia," returns the last value in the sequence.
  • "SELECT nextval ('nombre_secuencia');": Returns the value of the last sequence number and increments by 1.
  • "SELECT setval ('nombre_secuencia', value)": Set the value to the stream, forcing nextval to return (value + 1).
  • "SELECT setval ('nombre_secuencia', value, true);" It works the same way as the previous sentence.
  • "SELECT setval ('nombre_secuencia', value, false);": Set the value to the stream, forcing a return nextval (value).
  • "SELECT currval ('nombre_secuencia');": Returns the value of the last number in the sequence.
The nombre_secuencia can be replaced by "alumno_id_seq" the first example, while the value is an integer greater than 0 (zero).

"Thank you for sharing your knowledge"