[ The imperialist Japanese military must officially acknowledge and apologize for the coercion of young women into sexual slaves. / êꪤҳàõªòàõªÎÒ¿Ö˪˪·ª¿ð¨ÏÐñ«ëùìíÜâÏÚªÎ?ð¤àõªòÍëãÒªËìãªá¡¢Þóñªª·ªÊª±ªìªÐªÊªéªÊª¤. ]

»ç¿ëÀÚ

ID:
PW:

INDEX
01.°Ô½ÃÆÇ
°Ô½ÃÆÇ [72]
02.File Book
File ÀÚ·á½Ç [96]
Site Link [14]
°³ÀÎÆú´õ [201]
03.Field Book
Altibase [19]
Tibero [31]
MS-SQL [32]
MySQL [47]
DB2 [79]
ORACLE [3209]
PSQL [143]
CUBRID [5]
±âŸÁ¤º¸ [194]
¿î¿µÃ¼Á¦ [634]
04.Q/A Book
Q/A [53]
05.¹æ¸í·Ï
¹æ¸í·Ï [54]
·¹º§¾÷ [37]
±¸ÀÎ/±¸Á÷ [2]

±â³äÀÏ
Search
LINK
+ °¡Á· Hompy
+ DNSEver
IOTN :: Field Book :: PostgreSQL

 È¸¿ø°¡ÀÔ

PostgreSQL 14 / pgadmin Install [ lc_collate 'ko_KR.UTF-8' order by Á¤»ó ]
ÃÖ±æÈ£ [LIST]   2021-10-17 23:36:39, Á¶È¸ : 1,105

#PostgreSQL
https://www.postgresql.org/
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql14-server
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl enable postgresql-14
sudo systemctl start postgresql-14

# ¼³Ä¡ ÆÄÀÏ download
wget --no-check-certificate https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y pgdg-redhat-repo-latest.noarch.rpm
yumdownloader --resolve postgresql14-server
rpm -Uvh postgresql14-libs-14.0-1PGDG.rhel7.x86_64.rpm postgresql14-14.0-1PGDG.rhel7.x86_64.rpm postgresql14-server-14.0-1PGDG.rhel7.x86_64.rpm

# ¹æÈ­º® ¼³Á¤
systemctl status firewalld.service
firewall-cmd --permanent --zone=public --add-port=5432/tcp
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload
firewall-cmd --list-ports

# pgadmin
https://www.pgadmin.org/
rpm -e pgadmin4-redhat-repo
rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm
# Install for both desktop and web modes.
yum install pgadmin4
# Install for desktop mode only. # yum install pgadmin4-desktop
# Install for web mode only.     # yum install pgadmin4-web
/usr/pgadmin4/bin/setup-web.sh
Email address:
Password:
Retype password:
The Apache web server is not running. We can enable and start the web server for you to finish pgAdmin 4 installation. Continue (y/n)? y
Apache successfully enabled.
Apache successfully started.
You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4

# /usr/pgsql-14/bin  PATHÃß°¡
su - postgres
echo export PATH=/usr/pgsql-14/bin:\$PATH >> .bash_profile

. .bash_profile

vi $PGDATA/postgresql.conf
listen_addresses = '*'
vi $PGDATA/pg_hba.conf
host    all             all             0.0.0.0/0               md5
pg_ctl reload
# Àç½ÃÀÛ ÇØ¾ß Àû¿ë
pg_ctl stop
pg_ctl start

psql [dbname] [user] -h hostname -p 5432
psql admin admin -h localhost
admin=> \conninfo
You are connected to database "admin" as user "admin" on host "localhost" (address "::1") at port "5432".

psql admin
admin=#
postgres=# \c admin
You are now connected to database "admin" as user "postgres".
admin=# \conninfo
You are connected to database "admin" as user "postgres" via socket in "/var/run/postgresql" at port "5432".

--
psql
postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
admin     | admin    | UTF8     | ko_KR.UTF-8 | en_US.UTF-8 |
postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(3 rows)
postgres=# select version();
                                                 version                                                
---------------------------------------------------------------------------------------------------------
PostgreSQL 14.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
(1 row)

\l

\h create user
create user admin createdb createrole password 'pwd';

\h create database
create tablespace admin location '/data/pgsql/admin';
create database admin template template0
lc_collate 'ko_KR.UTF-8'
tablespace admin owner admin;

\c admin

create table ÇÑ±Û ( À̸§ varchar(10));
ERROR:  invalid byte sequence for encoding "UTF8": 0xc7 0xd1
set client_encoding ='uhc';
select '¾È³ç' ;

-- ÇÑ±Û order by
drop table test;
create table test ( À̸§ varchar(10));
insert into test values('°¡³ª');
insert into test values('´Ù¶ó');
insert into test values('1°¡');
insert into test values('1ÇÏ');
insert into test values('a°¡');
insert into test values('aÇÏ');
insert into test values('°¡1');
insert into test values('°¡2');
insert into test values('ÇÏ1');
insert into test values('ÇÏa');
select * from test order by 1;

en_US.UTF-8
À̸§
------
°¡³ª
´Ù¶ó
°¡1
ÇÏ1
1°¡
1ÇÏ
°¡2 [ en_US.UTF-8  order by ±âº» ¹ß»ý / => order by 1 collate "ko_KR.utf8" Á¤»ó ÀÛµ¿, https://sungtae-kim.tistory.com/68 ]
ÇÏa
a°¡
aÇÏ

ko_KR.UTF-8
À̸§
------
1°¡
1ÇÏ
a°¡
aÇÏ
°¡1
°¡2
°¡³ª
´Ù¶ó
ÇÏ1
ÇÏa

drop table test
ERROR:  must be owner of table test
SQL state: 42501
create table test
ERROR:  relation "test" already exists
SQL state: 42P07
insert into test values('°¡³ª');
ERROR:  permission denied for table test
SQL state: 42501
delete test;
ERROR:  syntax error at or near "test"
SQL state: 42601

admin=# select * from pg_tables where tablename='test';
schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers | rowsecurity
------------+-----------+------------+------------+------------+----------+-------------+-------------
public     | test      | postgres   |            | f          | f        | f           | f

admin=> alter table test owner to admin;
ERROR:  must be owner of table test

psql admin
admin=# [ #=> superuser ]
admin=# alter table test owner to admin;
ALTER TABLE

admin=# select * from pg_tables where tablename='test';
schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers | rowsecurity
------------+-----------+------------+------------+------------+----------+-------------+-------------
public     | test      | admin      |            | f          | f        | f           | f


216.73.216.139


  LIST

Á¦¸ñ ÀÛ¼ºÀÚ ÀÛ¼ºÀÏ Á¶È¸
Admin  write db log msg    ÃÖ±æÈ£ 2025/04/07 7
Admin  CentOS 5 ¼³Ä¡ °¡´É psql 11.22 ¼³Ä¡    ÃÖ±æÈ£ 2024/11/21 10
Admin  ERROR: permission denied: "RI_ConstraintTrigger_331308" is a system trigger / violates foreign key constraint    ÃÖ±æÈ£ 2024/10/28 22
Admin  ³¯Â¥ ¼ýÀÚ date unix epoch    ÃÖ±æÈ£ 2024/09/02 12
Admin  pg_backup_start / pg_backup_stop / psql ¼¼¼Ç À¯Áö / WARNING: aborting backup due to backend exiting before pg_backup_stop was called    ÃÖ±æÈ£ 2023/12/21 70
Admin  psql 10.7 oracle dblink [ oracle_fdw db link ]    ÃÖ±æÈ£ 2023/07/25 75
Admin  HA º¹±¸ test    ÃÖ±æÈ£ 2023/03/03 1867
Admin  log: COPY public.xxxx (xxx, xxx, xxx) TO stdout; / pg_dump ¹é¾÷½Ã ¹ß»ý    ÃÖ±æÈ£ 2023/03/03 51
Admin  requested timeline x is not a child of this server's history    ÃÖ±æÈ£ 2023/03/02 65
Admin  recovery_target_action / archive log ¹Þ¾Æ¼­ °è¼Ó º¹±¸    ÃÖ±æÈ£ 2023/02/28 67
Admin  recovery_target_action = 'pause' / select pg_wal_replay_pause(); / select pg_get_wal_replay_pause_state();    ÃÖ±æÈ£ 2023/02/27 53
Admin  memory buffer cache    ÃÖ±æÈ£ 2023/02/06 48
Admin  active session, pid, lock sql , kill pid / pg_terminate_backend    ÃÖ±æÈ£ 2023/02/06 122
Admin  psql HA    ÃÖ±æÈ£ 2023/02/05 560
Admin  pg_ctl start -D . | postmaster.pid | /tmp/.s.PGSQL.5432 |    ÃÖ±æÈ£ 2023/02/03 82

    ¸ñ·Ïº¸±â   ´ÙÀ½ÆäÀÌÁö 1 [2][3][4][5][6][7][8]
       

Copyright 1999-2025 Zeroboard / skin by ÃÖ±æÈ£(gilho.kr@gmail.com)
ÃÖ±Ù ´ñ±Û
ÃÖ±Ù °Ô½Ã¹°
07/04
[ORACLE]
impdp Slow While Creating View....
by ÃÖ±æÈ£
07/03
[ORACLE]
select username,last_login fro....
by ÃÖ±æÈ£
07/02
[¿î¿µÃ¼Á¦]
rsync -auv.
by ÃÖ±æÈ£