From: Devrim GUNDUZ (devrim@gunduz.org)
Date: Mon 14 Jul 2003 - 16:09:50 EEST
Merhaba,
On Mon, 14 Jul 2003 ougur@infotech.com.tr wrote:
> - mob_id diye bir alanım var.
> - pgadmin3 ile yada jdbc üzerinden
> .....................
> create MOBS................
> MOB_ID serial8........
> ........................................................
> diye tabloyu yaratıyorum.
>
> pgadmin ile baktığımda tablo adı mobs ve alan adı mob_Id olarak görünüyor.
> Şimdi ister istemez insan kuşkulanıyor demek bu dbms in i harfi ile bir
> sorunu var diye.
>
> ve select * from mobs where mob_id=1 gibi bir SQL çalışmıyor.
> hata mesajı olarak da mob_id diye bir alan yoktur diyor.
Az once de dedigim gibi, --locale=tr_TR ile derlerseniz derdiniz bitecek.
Uzun olacak ama asagida birseyler var:
============
[root@devrim root]# mkdir /db
[root@devrim root]# chown postgres: /db/ -R
[root@devrim root]# su - postgres
-bash-2.05b$ initdb /db --locale=tr
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.
The database cluster will be initialized with locale tr_TR.
This locale setting will prevent the use of indexes for pattern matching
operations. If that is a concern, rerun initdb with the collation order
set to "C". For more information see the Administrator's Guide.
Fixing permissions on existing directory /db... ok
creating directory /db/base... ok
creating directory /db/global... ok
creating directory /db/pg_xlog... ok
creating directory /db/pg_clog... ok
creating template1 database in /db/base/1... ok
creating configuration files... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
vacuuming database template1... ok
copying template1 to template0... ok
Success. You can now start the database server using:
/usr/bin/postmaster -D /db
or
/usr/bin/pg_ctl -D /db -l logfile start
-bash-2.05b$ /usr/bin/pg_ctl -D /db start
postmaster successfully started
-bash-2.05b$ LOG: database system was shut down at 2003-07-14 16:00:25
EEST
LOG: checkpoint record is at 0/7622AC
LOG: redo record is at 0/7622AC; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 480; next oid: 16886
LOG: database system is ready
-bash-2.05b$ psql template1
Welcome to psql 7.3.3, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=# \l
List of databases
Name | Owner | Encoding
-----------+----------+-----------
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(2 rows)
template1=# CREATE DATABASE regres
template1=# CREATE DATABASE regression;
CREATE DATABASE
template1=# \c regression
You are now connected to database regression.
regression=# CREATE TABLE bUyUk_HaRf (
regression(# DEVRIM_ID serial,
regression(# metin text
regression(# );
NOT: CREATE TABLE will create implicit sequence
'buyuk_harf_devrım_ıd_seq' for
SERIAL column 'buyuk_harf.devrım_ıd'
NOT: CREATE TABLE will create implicit sequence
'buyuk_harf_devrım_ıd_seq' for
SERIAL column 'buyuk_harf.devrım_ıd'
CREATE TABLE
regression=# \d
List of relations
Schema | Name | Type | Owner
--------+--------------------------+----------+----------
public | buyuk_harf | table | postgres
public | buyuk_harf_devrım_ıd_seq | sequence | postgres
regression=# INSERT INTO buyuk_harf (metin) VALUES ('asçlkaşsdl');
INSERT 16895 1
regression=# INSERT INTO buyuk_harf (metin) VALUES ('asçlkaşsd123123l');
INSERT 16896 1
regression=# INSERT INTO buyuk_harf (metin) VALUES
('asçlkaşsd123123sdfl');
INSERT 16897 1
regression=# SELECT * from buyuk_harf ;
devrım_ıd | metin
-----------+---------------------
1 | asçlkaşsdl
2 | asçlkaşsd123123l
3 | asçlkaşsd123123sdfl
(3 rows)
regression=# SELECT devrim_id FROM buyuk_harf ;
HATA: Attribute "devrim_id" not found
HATA: Attribute "devrim_id" not found
regression=# SELECT devrım_ıd FROM buyuk_harf ;
devrım_ıd
-----------
1
2
3
===================================================
regression=# CREATE DATABASE türkçe WITH ENCODING 'LATIN5';
CREATE DATABASE
regression=# \l
List of databases
Name | Owner | Encoding
------------+----------+-----------
regression | postgres | SQL_ASCII
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
türkçe | postgres | LATIN5
(4 rows)
regression=# \c türkçe
You are now connected to database türkçe.
türkçe=# CREATE TABLE üğişçö (
türkçe(# üüğğii serial,
türkçe(# ççööşş textş
türkçe(# );
NOT: CREATE TABLE will create implicit sequence 'üğişçö_üüğğii_seq' for
SERIAL column 'üğişçö.üüğğii'
NOT: CREATE TABLE will create implicit sequence 'üğişçö_üüğğii_seq' for
SERIAL column 'üğişçö.üüğğii'
CREATE TABLE
türkçe=# INSERT INTO üğişçö ( ççööşş ) VALUES ('q3w2344');
INSERT 16907 1
türkçe=# INSERT INTO üğişçö ( ççööşş ) VALUES ('q3w234asdasd4');
INSERT 16908 1
türkçe=# SELECT * FROM üğişçö
türkçe-# ;;
üüğğii | ççööşş
--------+---------------
1 | q3w2344
2 | q3w234asdasd4
(2 rows)
===============================================================
> Sonuç olarak, postgre büyük küçük harf ayrımı yapmıyor tamam ama anladığım
> kadarıyla SQL parse etmeden önce uppercase yapıyor hepsini büyük harfe
> çevirip parse etmeye kalkıyor. küçük i de büyük İ ye döndüğünde postgre
> alan adı bulunamadı gibi hata mesajları atıyor.
Locale locale locale sanirim.
Saygilar.
-- Devrim GUNDUZ devrim@gunduz.org devrim.gunduz@linux.org.tr http://www.tdmsoft.com http://www.gunduz.org