- tar.gzファイルをダウンロード
- 解凍
tar zxf php-8.2.10.tar.gz
- --enable
grep "\-\-enable" configure
- --with
grep "\-\-with" configure
SELECT
T.schemaname AS schemaName
,T.relname AS tableName
,CL.relname AS indexName
,IDX.index_no AS columnNo
,A.attname AS columnName
,C.udt_name AS columnType
,CASE
WHEN C.udt_name = 'numeric'
THEN C.numeric_precision_radix || ',' || C.numeric_scale
ELSE C.character_maximum_length || ''
END AS columnLength
,C.is_nullable AS isNull
,C.column_default AS columnDefault
,D.description AS description
FROM pg_stat_user_tables T
INNER JOIN (
SELECT UNNEST(array[indkey]) AS index_no, T.* FROM pg_index T
) IDX ON IDX.indrelid = T.relid
INNER JOIN pg_class CL
ON CL.oid = IDX.indexrelid
INNER JOIN pg_attribute A
ON A.attrelid = IDX.indrelid
AND A.attnum = IDX.index_no
INNER JOIN information_schema.COLUMNS C
ON C.table_schema = T.schemaname
AND C.table_name = T.relname
AND C.column_name = A.attname
LEFT JOIN pg_catalog.pg_description D
ON D.objoid = T.relid
AND D.objsubid = A.attnum
ORDER BY T.schemaname, T.relname,CL.relname,IDX.index_no;
SELECT
c.TABLE_NAME AS tableName
,c.ORDINAL_POSITION AS no
,c.COLUMN_KEY AS keyPrefix
,IF(idx.INDEX_NAME IS NULL, null,
CASE WHEN idx.INDEX_NAME = 'PRIMARY' THEN 'PK'
WHEN idx.NON_UNIQUE = 0 THEN 'UK'
ELSE idx.INDEX_NAME
END
) AS idx_name
,c.COLUMN_NAME AS name
,c.DATA_TYPE AS dataType
,IF(c.NUMERIC_SCALE IS NOT NULL,
CONCAT(c.NUMERIC_PRECISION, ',', c.NUMERIC_SCALE),
IF(c.NUMERIC_PRECISION IS NOT NULL,
c.NUMERIC_PRECISION,
c.CHARACTER_MAXIMUM_LENGTH)
) AS length
,IF( c.IS_NULLABLE = 'YES', true, false ) AS nullable
, CASE
WHEN c.IS_NULLABLE = 'YES' THEN ''
ELSE
CASE
WHEN c.EXTRA IS NULL AND c.COLUMN_DEFAULT IS NOT NULL
THEN c.COLUMN_DEFAULT
WHEN c.EXTRA IS NOT NULL AND c.COLUMN_DEFAULT IS NULL
THEN c.EXTRA
WHEN c.EXTRA IS NOT NULL AND c.COLUMN_DEFAULT IS NOT NULL
THEN CONCAT(c.COLUMN_DEFAULT, ' ', c.EXTRA)
ELSE c.COLUMN_DEFAULT
END
END AS defaultValue
,c.COLUMN_COMMENT AS comment
FROM information_schema.COLUMNS c
LEFT JOIN information_schema.STATISTICS idx
ON idx.TABLE_NAME=c.TABLE_NAME AND idx.COLUMN_NAME=c.COLUMN_NAME
WHERE
c.TABLE_SCHEMA = 'xxxxx'
ORDER BY
c.TABLE_NAME,c.ORDINAL_POSITION;
SELECT T.schemaname AS schemaName ,T.relname AS tableName ,A.attnum AS columnNo ,A.attname AS columnName ,C.udt_name AS columnType ,CASE WHEN C.udt_name = 'numeric' THEN C.numeric_precision_radix || ',' || C.numeric_scale ELSE C.character_maximum_length || '' END AS columnLength ,C.is_nullable AS isNull ,C.column_default AS columnDefault ,D.description AS description FROM pg_catalog.pg_stat_user_tables T INNER JOIN pg_catalog.pg_attribute A ON A.attrelid = T.relid LEFT JOIN pg_catalog.pg_description D ON D.objoid = T.relid AND D.objsubid = A.attnum INNER JOIN information_schema.columns C ON C.table_schema = T.schemaname AND C.table_name = T.relname AND C.column_name = A.attname WHERE A.attnum > 0 ORDER BY T.schemaname, T.relname, A.attnum;
package util;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class TextFileReader {
private BufferedReader reader = null;
public TextFileReader(String path)
throws IOException, FileNotFoundException {
this(path, "UTF-8");
}
public TextFileReader(String path, String charsetName)
throws IOException, FileNotFoundException {
this.reader = new BufferedReader( new InputStreamReader( new FileInputStream(path), charsetName) );
}
public ListgetLineAll()
throws IOException {
Listlist = new ArrayList ();
String line = null;
while( (line = this.reader.readLine()) != null ){
list.add(line);
}
return list;
}
public ListgetLineRange(int start, int end)
throws IOException {
Listlist = new ArrayList ();
int lineNo = 0;
String line = null;
while( (line = this.reader.readLine()) != null ){
lineNo++;
if( start <= lineNo && lineNo <= end ){
list.add(line);
}
}
return list;
}
public String getLine(int lineNo)
throws IOException {
String resultLine = null;
int _lineNo = 0;
String line = null;
while( (line = this.reader.readLine()) != null ){
_lineNo++;
if( _lineNo == lineNo ){
resultLine = line;
}
if( lineNo < _lineNo){
break;
}
}
return resultLine;
}
public void close(){
if( this.reader != null ){
try {
reader.close();
} catch (IOException e) {
} finally {
this.reader = null;
}
}
}
}
package util;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.List;
public class TextFileWriter {
private BufferedWriter writer = null;
private String newLine = System.getProperty("line.separator");
public TextFileWriter(String path)
throws IOException, FileNotFoundException {
this(path, "UTF-8");
}
public TextFileWriter(String path, String charsetName)
throws IOException, FileNotFoundException {
this.writer = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(""), charsetName));
}
public void setNewLine(String sLine){
this.newLine = sLine;
}
public void write(String line)
throws IOException {
this.writer.write(line);
}
public void writeLine(String line)
throws IOException {
this.writer.write(line);
this.writer.write(this.newLine);
}
public void output(Listlines)
throws IOException {
for(String line : lines){
this.writeLine(line);
}
}
public void close(){
if(this.writer != null){
try {
this.writer.close();
} catch (IOException e) {
} finally {
this.writer = null;
}
}
}
}