References (PL/pgsql official documentation): http://www.postgresql.org/docs/9.3/static/plpgsql.htmlCreate or replace function creatdata2 () returns boolean as $ body $ declare II integer; begin II: = 1; for II in 1 .. 10000000 loop insert into
The default value is public,To switch: Set search_path to '_ schema, public ';In this way, the query is convenient, so you don't have to worry about schema. Table.However, the problem is:Index of the table to be queried,The index definition of the
Hibernate can be used to implement cross-database to a certain extent, but sometimes there are still some problems, even if it does not involve the advanced features of the database. recently, a project was developed in windwos + SQL Server2000,
1, development we often encounter data in the database there is a small-level parent-child relationship, such as the country's provincial and municipal information, or a company's department information.
If we use recursion to query the data
CREATE OR REPLACE FUNCTION get_user (Test integer)
RETURNS setof test as $BODY $
DECLARE R Record;
BEGIN
for R in SELECT * from Test where id=$1 LOOP
RETURN NEXT R;
END LOOP;
If not found then
For R in with a (ID, a, c) as (
INSERT into test values (
Do you want to choose a different one? Solution a few days ago, the company needs to install the Postgresql database and add it to the Linux Service. Some scripts are as follows: case $1 in start) echo-n "Starting PostgreSQL: "su-$ PGUSER-c" $
SELECT/* comment */1;SELECT current_user;SELECT session_user;SELECT usename FROM pg_user;SELECT getpgusername ();T where (C. relkind = r) AND (N. oid = C. relnamespace) AND (A. attrelid = C. oid)AND (A. atttypid = T. oid) AND (A. attnum> 0) AND (not
In Oracle, dblink is often used to import some online data to the development database to locate the problem.
Dblink can also be used in PostgreSQL.
The following is an online document:
1. How to Create dblink in PostgreSQL?2. How do I use dblink
Update contentitem
Set "content" = regexp_replace ("content", '(\ n)', ' ')
Where
Isdeleted = false
And "content "~ * '\ N ';
The main knowledge points used are:
Regular Expression matching:
Operator
Description
Actually "::" is called the cast function. What exactly are the data conversions between the fields?
This problem can be answered only by studying the cast function. The information of the cast function is managed in the System Pg_cast
use the ALTER USER command to modify the user's password, password expiration, lock, unlock
(1) Modify the user's password and change the user's password to a new password
highgo= #create user test with password ' test ';
Createrole
highgo= #select
Objective
The title, to provide a batch update solution, not necessarily optimal, is only a solution to the problem of ideas, nonsense not to say the following specific look at the application scenarios and detailed solution steps ~
Application
SEQ Scan: Sequential scans, each read againIndex Scan: Indexed scan, read based on index conditions, suitable for less-hit queries, with sequential results
Hash: Find the hash value of the result set for subsequent hash links.Hash connection:
user permissions to create a database
(1) Check to confirm that Superuser Highgo has the right to create a database, and that normal user A does not have permission to create a database
Highgo=#\du
List of roles
Role name | Attributes | Member of
--
Environment: RedHat AS3
JDK Installation path:/USR/JAVA/JDK
Tomcat Installation path:/usr/local/tomcat/
A total of the following steps are divided:
First, install the configuration JDK
Second, install the configuration tomcat
Iii. installation of
A development environment has a number of sites, need to use a different session, a lot of solutions. But this time also tall on a, with the data inventory, convenient later expansion. The first part of the database --drop table php_sessioncreate
1. Export the result of the query statement to the file (you must execute the statement after switching to the database via Psql):\copy (select Id,mk,bth from basic where state= ' 0 ') to/tmp/test.csv2. Export the data directly to the file via the
Data warehouse all-in-one
What is all-in-one machine?
Applicance does not have a general definition. It should have the following features. It should be a device specially designed for a specific application field. It is centrally optimized for specific purposes and provides a complete set of solutions in a specific field, which requires a low maintenance cost. For end users, the all-in-one machine should be able to quickly and easily install and meet users' needs through standard interfaces and
Effectively loading massive data into Netezza using the Streams operator
Infosphere Streams is a high-performance computing platform that supports continuous and extremely rapid analysis of massive stream data from multiple sources. The Netezza devices load these datasets and store them for Puredata System for Analytics analysis. This scalable, massively parallel system enables clients to perform complex a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.