Ellhniko Database-SQL-RDBMS HOW-TO gia Linux (PostgreSQL -Antikeimenostrafes Sxesiako Susthma Bashs Dedomenwn)

Al Dev (Alavoor Vasudevan) alavoor@yahoo.com v11.0, 8 Ianoyarioy 1999

Ayto to keimeno einai enas ”praktikos odhgos” gia na egkatasthsete grhgora thn SQL Database engine kai ta front end ergaleia ths se ena susthma Unix. Mila epishs gia th Die8nh glwssa Protupwn (International Standard language) ANSI/ISO SQL kai ejetazei ta pleonekthmata ths SQL database engine poy exei anaptyx8ei apo to worldwide internet katw apo ena ”anoikto periballon anaptyjhs”. Prokeitai gia to PWS (HOW-TO) na egkatasthsete thn Antikeimenostrafh Sxesiakh SQL Bash epomenhs genias ”PostgreSQL” se ena susthma Unix to opoio mporei na xrhsimopoih8ei san Application Database Server h san Web Database Server. H PostgreSQL ylopoiei ena yposunolo toy Die8nous Protupoy ISO kai ANSI SQL 1998,92,89. Ayto to keimeno dinei epishs plhrofories gia ta programmata diasundeshs me th bash opws ta Front End GUIs, gia ergaleia RAD (Rapid Application Development), gia interfaces glwsswn programmatismou ”C”, ”C++”, Java, Perl, ODBC, JDBC odhgous kai ergaleia sundeshs ths bashs me Web kai programmata grafikhs diasundeshs. Oi plhrofories poy dinontai edw isxuoyn gia oles tis platformes Unix kai gia alles baseis epishs kai 8a einai polu xrhsimes se atoma nea sto xwro twn Basewn, ths glwssas SQL kai ths PostgreSQL. Ayto to keimeno exei epishs odhgo ekma8hshs ths SQL, kai h suntajh SQL 8a fanei polu xrhsimh stoys arxarioys. Oi empeiroi 8a broyn xrhsimo ayto to keimeno san proxeiro odhgo anaforas. Gia toys foithtes, oi plhrofories poy dinontai edw 8a toys kanei ikanous na paroyn ton phgaio kwdika apo th sxesiakh bash dedomenwn PostgreSQL, ap’ opoy mporoun na ma8oyn pws grafetai mia sxesiakh SQL bash dedomenwn.

Contents

1 Eisagwgh 5

2 Alles Morfes aytou toy keimenoy 8

3 Oi nomoi ths Fysikhs efarmozontai sto logismiko! 9

4 Ti einai h PostgreSQL ; 11

5 Pou mporw na th brw ; 13

6 H PostgreSQL yposthrizei ejairetika megales baseis, megaluteres apo 200 Gig 15

7 Pws mporw na empistey8w thn PostgreSQL ; To paketo Regression gia test anaptussei to ais8hma empistosunhs ston pelath 15

8 Grafiko programma epikoinwnias (GUI FrontEnd Tool) me thn PostgreSQL 16

9 Ergaleia enos Oloklhrwmenoy Systhmatos Anaptyjhs gia PostgreSQL (GUI IDE) 16

10 Odhgoi Diasundeshs me thn PostgreSQL 17

10.1 ODBC Drivers gia thn PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 10.2 UDBC Drivers gia thn PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 10.3 JDBC Drivers gia thn PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 10.4 Java gia PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

11 Perl Database Interface (DBI) Driver gia PostgreSQL 18 11.1 Diasundesh Perl 5 me PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 11.2 Perl Database Interface DBI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

11.2.1 TI EINAI TO DBI ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 11.2.2 Odhgos DBI gia thn PostgreSQL - DBD-Pg-0.89 . . . . . . . . . . . . . . . . . . . . . 20 11.2.3 Texnikh yposthrijh gia to DBI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 11.2.4 Ti einai ta DBI, DBperl, Oraperl kai *perl; . . . . . . . . . . . . . . . . . . . . . . . . 20 11.2.5 Prodiagrafes DBI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 11.2.6 Problhmata Metaglwttishs h alliws ”Kophke stis Ejetaseis!” . . . . . . . . . . . . . . . 23 11.2.7 Yposthrizetai to DBI katw apo platformes Windows 95 / NT ; . . . . . . . . . . . . . 24 11.2.8 Ti einai to DBM; Kai giati 8a prepei na xrhsimopoiw to DBI sth 8esh toy; . . . . . . 24 11.2.9 Yposthrizetai < to tade xarakthristiko > sto DBI; . . . . . . . . . . . . . . . . . . . . 24 11.2.10 Xrhsimeuei ka8oloy to DBI gia programmatismo se CGI; . . . . . . . . . . . . . . . . 24 11.2.11 Pws petyxainw taxuteroys xronoys sundeshs me DBD Oracle kai CGI; . . . . . . . . . 25 11.2.12 Pws epitygxanw monimes (persistent) syndeseis metaju DBI kai CGI . . . . . . . . . . 25 11.2.13 “Otan trexw ena perl script apo thn grammh entolhs, doyleuei, alla otan to trexw apo

ton httpd, apotygxanei!” Giati; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 11.2.14 Mporw na kanw multi-threading me to DBI; . . . . . . . . . . . . . . . . . . . . . . . 26 11.2.15 Pws mporw na kalesw stored procedures me to DBI; . . . . . . . . . . . . . . . . . . . 26 11.2.16 Pws mporw na parw tis times poy epistrefontai apo tis stored procedures me to DBI; 26 11.2.17 Pws mporw na dhmioyrghsw h na katastrecw mia bash dedomenwn me to DBI; …. 26 11.2.18 Pws diaxeirizetai to DBI tis times NULL ; . . . . . . . . . . . . . . . . . . . . . . . . . 26 11.2.19 Ti einai aytes oi me8odoi func (func methods); . . . . . . . . . . . . . . . . . . . . . . 27 11.2.20 Emporikh Yposthrijh kai Ekpaideysh . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

12 Ergaleia Diaxeirishs ths PostgreSQL 27 12.1 PGACCESS - Ena grafiko ergaleio gia th diaxeirish ths PostgreSQL . . . . . . . . . . . . . . 27 12.2 Windows Interactive Query Tool gia PostgreSQL (WISQL h MPSQL) . . . . . . . . . . . . . 29 12.3 Interactive Query Tool(ISQL) gia thn PostgreSQL - Onomazetai PSQL . . . . . . . . . . . . 29 12.4 MPMGR - Ergaleio Diaxeirishs Basewn gia PostgresSQL . . . . . . . . . . . . . . . . . . . . . 29

13 Ry8mizontas pollapla koytia PostgreSQL se mia o8onh 29 14 Efarmoges kai Ergaleia gia thn PostgreSQL 32

14.1 Glwssa 4hs genias (4GL) PostgreSQL gia efarmoges me web kai bash dedomenwn - Platforma

anaptyjhs AppGEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 14.2 WWW Web interface gia PostgresSQL - DBENGINE . . . . . . . . . . . . . . . . . . . . . . 32 14.3 Apache Webserver Module gia PostgreSQL - NeoSoft NeoWebScript . . . . . . . . . . . . . . 33 14.4 Oi HEITML epektaseis ths HTML ston server kai mia glwssa 4hs genias gia thn PostgreSQL 34 14.5 America On-line AOL Web server gia PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . 36 14.6 Problem/Project Tracking System Application Tool gia PostgreSQL . . . . . . . . . . . . . . 36 14.7 Metatroph arxeiwn dbase dbf se PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

15 Ergaleio gia Sxediasmo/Ylopoihsh Web Basewn Dedomenwn gia thn PostgreSQL - EARP 36 15.1 Ti einai to EARP ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 15.2 Ylopoihsh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 15.3 Ti xreiazeste gia na trejete to EARP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 15.4 Pws doyleuei ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 15.5 Pou 8a to brw ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

16 PHP Hypertext Preprocessor, mia scripting glwssa gia thn PostgreSQL h opoia enswmatwnetai se html kai ekteleitai sto Server 38 16.1 Kuria xarakthristika . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 16.2 Anagnwrish/Eyxaristies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 16.3 PHP 3 - Suntomo Istoriko . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 16.4 Ti mporw na kanw, loipon, me to PHP/FI ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 16.5 Ena aplo paradeigma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 16.6 CGI Redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

16.6.1 Shmeiwseis gia ton Apache 1.0.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 16.6.2 Netscape HTTPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 16.6.3 NCSA HTTPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

16.7 Trexontas to PHP/FI apo th grammh entolwn . . . . . . . . . . . . . . . . . . . . . . . . . . 43

17 Diasundesh me PostgreSQL mesw Python 43 17.1 Pou mporw na brw to PyGres ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 17.2 Plhrofories kai yposthrijh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

18 Epikoinwnia metaju PostgreSQL kai WWW - WDB-P95 45 18.1 Sxetika me to wdb-p95 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 18.2 Einai aparaithto o diakomisths ths PostgreSQL, to pgperl, kai to httpd na einai ston idio host; 45 19 Programmatistikes diasyndeseis gia ”C”, ”C++”, ESQL/C kai Dyadikoi Telestes gia thn

PostgreSQL 45 19.1 Diasundesh glwssas ”C” me thn PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 19.2 Interface glwssas ”C++” gia thn PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 19.3 ESQL/C gia PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 19.4 Dyadikoi Telestes gia thn PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

20 Japanese Kanji Kwdikas gia thn PostgreSQL 46

21 Metafora ths PostgreSQL se Windows 95/Windows NT 47

22 Listes allhlografias 47 22.1 Apokthste ena dwrean logariasmo e-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 22.2 Agglikh Lista Allhlografias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 22.3 Arxeio ths Listas Allhlografias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 22.4 Ispanikh Lista Allhlografias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

23 Tekmhriwsh kai Bibliografia 48 23.1 Odhgoi ekma8hshs kai Egxeiridia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 23.2 Online Tekmhriwsh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 23.3 Xrhsimh Bibliografia Anaforas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 23.4 Keimena prodiagrafwn ANSI/ISO SQL - SQL 1992, SQL 1998 . . . . . . . . . . . . . . . . . 50 23.5 Suntajh ANSI/ISO SQL 1992 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 23.6 Suntajh ANSI/ISO SQL 1998 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 23.7 Odhgos ekma8hshs SQL gia arxarioys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 23.8 Proswrinh epektash (extension) sto SQL92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 23.9 Tmhma 0 - Apoktwntas ta keimena ISO/ANSI SQL . . . . . . . . . . . . . . . . . . . . . . . 52 23.10Tmhma 1 - Trexoysa katastash toy ISO/ANSI SQL . . . . . . . . . . . . . . . . . . . . . . . . 55 23.11Tmhma 2 - ISO/ANSI SQL Foundation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 23.12Tmhma 3 - ISO/ANSI SQL Call Level Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 59 23.13Tmhma 4 - ISO/ANSI SQL Persistent Stored Modules . . . . . . . . . . . . . . . . . . . . . . 59 23.14Tmhma 5 - Typopoihseis - Desmeuseis ISO/ANSI SQL/ ISO/ANSI SQL/Bindings . . . . . . 61 23.15Tmhma 6 - ISO/ANSI SQL XA Interface Specialization (SQL/XA) . . . . . . . . . . . . . . . 61 23.16Part 7 - ISO/ANSI SQL Temporal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

23.16.1 EISAGWGH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 23.16.2 MIA MELETH- APO8HKEYSH SYGXRONWN/TREXOYSWN PLHROFORIWN . 62 23.16.3 MELETH - APO8HKEYSH ISTORIKWN PLHROFORIWN . . . . . . . . . . . . . . 63 23.16.4 MELETH - PROBOLH (PROJECTION) . . . . . . . . . . . . . . . . . . . . . . . . . 63 23.16.5 MELETH - SYSXETISMOS (JOIN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 23.16.6 MELETH - A8ROISTIKOI TELESTES (AGGREGATES) . . . . . . . . . . . . . . . 66

23.16.7 PERILHYH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

23.17Tmhma 8 - ISO/ANSI POLYMESA SQL (SQL MULTIMEDIA - SQL/MM) . . . . . . . . . 68

24 Texnikh yposthrijh gia thn PostgreSQL 68

25 Oikonomika kai Epaggelmatika 8emata 69

26 Lista allwn basewn dedomenwn 69

27 Xrhsimes symboyles gia anazhthseis sto Internet World Wide Web 70

28 Symperasma 70

29 Syxna Diatypwmenes Erwthseis sxetika me thn PostgreSQL 71

30 Shmeiwsh Pneymatikwn Dikaiwmatwn 71

A Pararthma A - Suntajh toy ANSI/ISO SQL 1992 71

B Pararthma B - Odhgos Ekma8hshs SQL gia arxarioys 118

B.1 Odhgos Ekma8hshs gia PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

B.2 Deiktes Internet diey8unsewn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

C Appendix C - Odhgies gia grhgorh egkatastash Linux 119

1 Eisagwgh

O skopos aytou toy keimenoy einai na dwsei katanohtous deiktes/URLs gia na sthsete grhgora thn PostgreSQL kai epishs na yperaspistei ta pleonekthmata enos Anoiktou Systhmatos Phgaioy Kwdika (Open Source Code) opws h PostgreSQL, Linux.

Ka8e susthma ypologisth ston kosmo xreiazetai mia bash dedomenwn gia na apo8hkeuei /anakta plhrofories. O kurios logos poy xrhsimopoioume ton ypologisth einai gia na apo8hkeuoyme, na anaktoume kai na epejergazomaste thn plhroforia kai na ta kanoyme ola ayta grhgora, ejoikonomwntas etsi xrono. Taytoxrona, to susthma prepei na einai aplo, ajiopisto, oikonomiko kai polu eukolo sth xrhsh toy. H Bash Dedomenwn einai SYSTHMA ZWTIKHS SHMASIAS gia ka8e etairia ston kosmo mia kai se ayth apo8hkeuontai polu shmantikes plhrofories. Ta pio dhmofilh systhmata basewn dedomenwn basizontai stis SQL prodiagrafes toy Die8nous Organismou Protupwn ISO (International Standard Organisation) oi opoies basizontai me th seira toys sto protypo ANSI SQL (Amerikaniko). Oi trexoyses prodiagrafes poy xrhsimopoiountai eyrews einai oi ISO/ANSI SQL 1992. To mellontiko protypo einai to SQL 1998/99 gnwsto kai san SQL-3 kai anaptussetai akomh. Dhmofileis baseis opws h Oracle, h Sybase kai Informix einai systhmata basismena se ayta ta protypa h prospa8oun na ta ylopoihsoyn.

Opws fainetai se ayto to keimeno, yparxoyn perissotera apo 20 diaforetika systhmata basewn dedomenwn, emporika/basismena sto internet, poy xrhsimopoiountai se olo ton kosmo kai polla perissotera 8a emfanistoun sto prosexes mellon. Xwris ena protypo opws to ANSI/ISO SQL, 8a htan polu duskolo gia ton pelath na anaptujei mia efarmogh mia mono fora kai na th trexei se ola ta systhmata basewn dedomenwn. O shmerinos pelaths 8elei na anaptujei mia efarmogh mia fora xrhsimopoiwntas ISO SQL, ODBC, JDBC kai na thn poylhsei wste na xrhsimopoieitai se ola ta diaforetika systhmata basewn dedomenwn ston kosmo.

H dhmofilesterh pagkosmiws DWREAN bash, poy ylopoiei tmhma toy ISO SQL, ANSI SQL/98, SQL/92 kai ANSI SQL/89 RDBMS einai h PostgreSQL. H PostgreSQL einai h Antikeimenostrafhs Sxesiakh SQL Bash epomenhs genias kai ta mellontika protypa ANSI SQL opws to SQL 1998 (SQL-3) kai pera 8a asxolountai olo kai perissotero me Antikeimenostrafeis Baseis kai tupoys dedomenwn Antikeimenoy (Object data types). H PostgreSQL einai to mono dwrean RDBMS ston kosmo poy yposthrizei Antikeimenostrafeis Baseis kai SQL. Ayto to keimeno 8a sas pei pws na egkatasthsete th bash kai, epishs, ola ta paketa sxetika me baseis, pws na egkatasthsete Web database, application database, grafika programmata epikoinwnias kai xeirismou (front end GUIs kai programmata interface). Sas symboyleuoyme na gracete OPWSDHPOTE tis efarmoges basewn 100 % symbates me ta protypa ISO/ANSI SQL, ODBC, JDBC, etsi wste h efarmogh sas na einai metafersimh se polles baseis opws oi PostgreSQL, Oracle, Sybase, Informix klp.

Me thn PostgreSQL, 8a exete thn ychloterh poiothta kai polla alla xarakthristika mia kai akoloy8ei to ’Anoikto Montelo Anaptyjhs Phgaioy Kwdika’ (Open Source Code development). To Anoikto montelo Anaptyjhs Phgaioy Kwdika einai to mono toy opoioy mporeite na parete olon ton phgaio kwdika, kai h anaptyjh ginetai sto internet apo ejairetika megalo diktyo an8rwpinwn myalwn. H mellontikh moda problepei oti h megaluterh anaptyjh logismikou 8a ginetai sthn apokaloumenh ”Yperlewforo Plhroforiwn” (Information Super-Highway) poy diatrexei olo ton kosmo. Sta xronia poy erxontai, h anaptyjh toy internet 8a einai ekrhktikh h opoia me th seira ths 8a pyrodothsei th grhgorh yio8ethsh ths PostgreSQL apo toys pelates.

Efarmozontas tis arxes ths fysikhs (kbantomhxanikh, klassikh, 8ermodynamikh), twn ma8hmatikwn kai ths statistikhs sthn poiothta toy logismikou, pairnete thn ychloterh poiothta logismikou mono se ena ’Anoikto Susthma Phgaioy Kwdika’ opws h PostgreSQL anoigontas ton phgaio kwdika se ena pelwrio ari8mo an8rwpinwn myalwn diasyndedemenwn mesw ths Yperlewforoy Plhroforiwn. Oso megaluteros o ari8mos twn an8rwpwn poy ergazontai panw s’ ayto, toso kaluterh 8a einai h poiothta toy logismikou. To Anoikto Montelo Phgaioy Kwdika 8a empodisei epishs thn anakalych toy troxou apo thn arxh , 8a meiwsei th diplh doyleia kai 8a einai polu oikonomiko, 8a ejoikonomei xrono sth dianomh kai akoloy8ei toys nomoys ths monternas oikonomias gia beltistopoihsh twn e8nikwn kai genikwn porwn. Otan mia ergasia logismikou exei ginei apo alloys, tote DEN xreiazetai na thn kanete eseis pali. De 8a spatalhsete ton polutimo xrono sas se kati poy exei hdh ginei kala. Ka8ws 8a mpainoyme ston 21o aiwna, 8a yparxei allagh ston tropo poy pairnoyme to logismiko gia xrhsh. Oi pelates 8a protimoun ta anoikta systhmata logismikou opws h PostgreSQL, to Linux klp.

An agorasete ektelesima programmata, de 8a parete kai ton kwdika kai ta dikaiwmata toy. O phgaios kwdikas einai anektimhto stoixeio enw ta ektelesima den exoyn kamia ajia. To na agorasete logismiko mporei na anhkei sto parel8on. Gia na agorasete kalo yliko (hardware), ajizei na jodecete xrhmata kai na parete to logismiko apo to internet. Shmantiko shmeio einai to yliko toy ypologisth to opoio kanei ton kurio ogko ths doyleias. To yliko einai to alogo poy kanei th doyleia enw to logismiko apla to odhgei. To yliko twn ypologistwn einai polu poluploko kai mono 6 apo tis 180 xwres ston kosmo mexri twra exoyn epideijei thn ikanothta sxediasmou kai kataskeyhs plaketwn/ylikou ypologistwn. O sxediasmos kai h kataskeyh chips ypologistwn einai prohgmenh texnologia. Einai mia polu sun8eth diadikasia, dapanhrh, apaitei megales ependuseis se ergostasia kai mhxanes paragwghs poy doyleuoyn me texnologia 0.18 micron. Se ena mikro chip silikonhs ekatommuria tranzistors/kyklwmata einai stena paketarismena. Etaireies opws oi AMD, Intel, Cyrix, Hitachi, IBM kai alles jodecan shmantiko ari8mo apo an8rwpoxronia gia na ginoyn kurioi ychlwn texnologiwn opws h mikrohlektronikh (Micro-electronics) kai h nanohlektronikh (Nano-electronics). Micro shmainei (ena-ekatommyriosto toy metroy 10ˆ -6), Nano shmainei (ena-disekatommyriosto toy metroy 10ˆ - 9). H trexoysa texnologia xrhsimopoiei mikrohlektronikh gurw sta 0.35 micron xrhsimopoiwntas agwgous aloyminioy, kai mege8h twn 0.25 micron xrhsimopoiwntas agwgous hlektroniwn apo xalko. Sto kontino mas mellon 8a xrhsimopoih8ei texnologia twn 0.10 micron me xalko kai nanohlektronikh gia na ftiajoyn tsipakia ypologisth. Oi agwgoi aloyminioy 8a antikatasta8oun apo xalko sta chips twn ypologistwn, ka8ws o xalkos einai kaluteros agwgos twn hlektroniwn. Sth fwtoli8ografia, 8a xrhsimopoih8oun texnikes yperiwdoys aktinobolias, aktines X h desmhs hlektroniwn gia xarajh kyklwmatwn me mellontika mege8h mikrotera twn 0.15 micron.

Se 20 xronia apo twra, ta tsip silikonhs 8a antikatasta8oun apo moriakous ypologistes kai biotsips poy 8a einai disekatommuria fores grhgorotera apo ta tsip silikonhs. Ta moria einai ena sunolo atomwn. Kai ta atoma einai ta mikra swmatidia poy apoteloun o,ti blepete se ayto ton kosmo. Oi moriakoi ypologistes 8a xrhsimopoioun ta moria ths ulhs san ypergrhgoroys diakoptes on/off. Otan o diakopths einai ON shmainei 1, kai otan einai OFF shmainei 0. Ola ta programmata se ayton ton kosmo basizontai sto dyadiko susthma.

O parakatw pinakas deixnei th proodo kai tis mellontikes taseis proodoy twn chips twn ypologistwn.

                          Advancement of chip capabilities in future
                         ********************************************
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | Item/Year                | 1997    | 1999    | 2001    | 2003    | 2012   | 2020    |
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | Feature size(micron)     | 0.25    | 0.18    | 0.15    | 0.13    | 0.05   |< 0.00001|
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | Wafer size(mm)           | 200     | 300     | 300     | 300     | 450    | Mol/Bio |
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | Min Operating Voltage    | 1.8-2.5 | 1.5-1.8 | 1.2-1.5 | 1.2-1.5 | 0.5-0.6| < 0.001 |
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | Max power dissipation    | 70      | 90      | 110     | 130     | 175    | 600     |
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | On-chip frequencey (MHz) | 750     | 1,250   | 1,500   | 2,100   | 10,000 | > 50,000|
     +--------------------------+---------+---------+---------+---------+--------+---------+
     | DRAM capacity            | 256 MB  | 1 GB    | 2 GB    | 4 GB    | 256 GB | > 1000GB|
     +--------------------------+---------+---------+---------+---------+--------+---------+

Opws blepete, to yliko einai ychlhs texnologias kai shmantiko enw to logismiko einai ligotero duskolh texnologia. Ara, h kataskeyh ylikou/ylikwn-aga8wn einai zwtikhs shmasias gia thn e8nikh oikonomia! Etaireies opws oi Compaq, Dell, Sun Microsystems, HP, IBM poy kataskeyazoyn ypologistes einai oi kurioi syneisferontes sthn oikonomia ths Amerikhs shmera kai sto mellon!!

Apo thn allh, ka8e xwra anejairetws ston kosmo anaptussei/ftiaxnei logismiko. Sthn pragmatikothta, opoiosdhpote ston kosmo me ena mikro PC xamhlou-kostoys mporei na dhmioyrghsei ena susthma mias bashs dedomenwn san thn Oracle . Alla 8a toy epairne 10 xronia (o diakomisths ths Oracle einai peripoy 10 an8rwpo-eth doyleia). Ena an8rwpo-etos einai ena atomo poy doyleuei me plhrh apasxolhsh gia ena oloklhro etos. An 10 an8rwpoi ergazontai gia 10 eth tote exoyn jodeytei 10 an8rwpo-eth.

Baseis opws oi Oracle, Informix, Sybase, IBM DB2 (Unix) grafthkan se glwssa ”C” kai ta ektelesima dhmioyrgh8hkan metaglwttizontas ton kwdika kai meta apostal8hkan stoys pelates. Oi baseis Oracle, Sybase, Informix einai programmata 100 % ”C”!!

Mia kai exei ginei pollh doyleia sthn PostgreSQL ta teleytaia 12 xronia, den exei nohma janadhmioyrghsoyme apo thn arxh mia allh bash poy na ikanopoiei to protypo ANSI/ISO SQL. Einai megalo pleonekthma na xrhsimopoihsoyme ton yparxonta kwdika kai na pros8esoyme ta xarakthristika poy leipoyn h pros8hkes sthn PostgreSQL kai na arxisoyme na th xrhsimopoioume amesws.

H PostgreSQL den einai apla mia dwrean bash alla ena kalhs poiothtas ’Proion Internet’. Problepetai oti h zhthsh proiontwn ”Made By Internet” 8a ayjh8ei ek8etika mia kai einai ikano na diathrei ychlh poiothta, xamhlo kostos, ejairetika megalh bash xrhstwn kai atomwn poy anaptussoyn kwdika. Ayta ta e8nh poy de xrhsimopoioun ta proionta ’Made By Internet’ 8a xasoyn sobara thn ”Epanastash World-wide Internet” kai 8a meinoyn polu pisw apo tis alles xwres. O logos einai oti to idio to ”Internet” einai h megaluterh etaireia paragwghs logismikou se olo ton kosmo!

2 Alles Morfes aytou toy keimenoy

Ayto to keimeno einai typwmeno se 10 diaforetikes morfes, onomastika - DVI, Postscript, Latex, LyX, GNUinfo, HTML, RTF (Rich Text Format), Plain-text, Selides boh8eias Unix (Unix man pages) kai SGML.

• Mporeite na parete ayto to keimeno HOWTO san ena arxeio tar se morfh HTML, DVI, Postscript h

     SGML apo to - <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/>
   • H aplh morfh keimenoy brisketai sto: <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO>

• Gia sxolia, parathrhseis, dior8wseis, enhmerwseis peri ths Ellhnikhs metafrashs aytou toy HOWTO, steilte email sthn Boula Sanida : voulariba@hellug.gr h ston Eyripidh Papakwsta : evris@hellug.

     gr kai enallaktika : ep@rocketmail.com

• Metafraseis se alles glwsses opws Gallika, Germanika, Ispanika, Kinezika, Giapwnezika briskontai

     sto <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO> Opoiadhpote boh8eia gia metafrash se alles

glwsses einai eyprosdekth.

To keimeno grafthke xrhsimopoiwntas ta ”ergaleia SGML” ta opoia 8a ta breite sto - <http://www.xs4all. nl/~cg/sgmltools/> Afou metaglwttisete ton kwdika 8a exete entoles opws

• sgml2html databasehowto.sgml (gia na dhmioyrghsete arxeia html)

• sgml2rtf databasehowto.sgml (gia na dhmioyrghsete arxeia RTF)

• sgml2latex databasehowto.sgml (gia na dhmioyrghsete arxeia latex)

To keimeno brisketai sto -

   • <http://sunsite.unc.edu/LDP/HOWTO/PostgreSQL-HOWTO.html>

Mporeite epishs na breite to keimeno sta parakatw mirrors sites -

   • <http://www.caldera.com/LDP/HOWTO/PostgreSQL-HOWTO.html>
   • <http://www.WGS.com/LDP/HOWTO/PostgreSQL-HOWTO.html>
   • <http://www.cc.gatech.edu/linux/LDP/HOWTO/PostgreSQL-HOWTO.html>
   • <http://www.redhat.com/linux-info/ldp/HOWTO/PostgreSQL-HOWTO.html>

• Alla mirror sites konta sas (network-address-wise) mporeite na breite sto <http://sunsite.unc. edu/LDP/hmirrors.html> dialejte ena site kai phgainete ston katalogo /LDP/HOWTO/PostgreSQL-HOWTO.html

Gia na deite to keimeno se morfh dvi, xrhsimopoihste to programma xdvi. To programma xdvi brisketai sto paketo tetex-xdvi*.rpm sto Redhat Linux to opoio brisketai sta koympia ControlPanel | Applications | Publishing | TeX menu. Gia na diabasete keimeno dvi dwste thn entolh -

xdvi -geometry 80x90 howto.dvi

kai allajte to mege8os toy para8uroy me to pontiki. Deite th selida boh8eias gia to xdvi.

Gia na metakinh8eite xrhsimopoihste ta belakia, ta plhktra Page Up, Page Down, mporeite na xrhsimopoihsete epishs ta grammata ’f’, ’d’, ’u’, ’c’, ’l’, ’r’, ’p’, ’n’ gia na metakinh8eite pros ta panw, katw, sto kentro, sthn epomenh selida, sthn prohgoumenh selida klp.

Gia na apenergopoihsete to expert menou pathste ’x’. Mporeite na diabasete arxeia postscript xrhsimopoiwntas to ’gv’ (ghostview) h ’ghostscript’. To programma ghostscript brisketai sto paketo ghostscript*.rpm kai to programma gv sto paketo gv*.rpm sto Redhat Linux to opoio brisketai sta koympia twn menou ControlPanel | Applications | Graphics. To programma gv einai polu pio filiko sto xrhsth apo to ghostscript. To ghostscript kai to gv einai epishs dia8esima kai se alles platformes opws se OS/2, Windows 95 kai NT, blepete ayto to keimeno akomh kai se aytes tis platformes.

             Gia na diabasete keimeno postscript dwste thn entolh  -
                     gv howto.ps
             Gia na xrhsimopoihsete to ghostscript thn entolh -
                     ghostscript howto.ps

PROSOXH: To keimeno ayto einai megalo, o synolikos ari8mos selidwn (se postscript) an typw8ei 8a einai peripoy 113 selides sta Agglika (sta ellhnika 8a prepei na einai perissoteres).

Mporeite na diabasete to keimeno se morfh HTML xrhsimopoiwntas Netscape Navigator, Microsoft Internet explorer, Redhat Baron Web browser h opoiodhpote apo toys alloys 10 web browsers.

Mporeite na diabasete thn ejodo toy se latex, LyX xrhsimopoiwntas to LyX, ena X-Windows grafiko programma diasundeshs me latex.

3 Oi nomoi ths Fysikhs efarmozontai sto logismiko!

Se ayto to kefalaio, 8a sas deijoyme pws h episthmh paizei shmantiko rolo sth dhmioyrgia diaforwn antikeimenwn opws to logismiko, to sumpan, ta atoma, thn energeia akoma kai esas toys idioys! Ayto to kefalaio 8a sas deijei epishs giati h gnwsh ths episthmhs einai polu shmantikh PRIN na jekinhsete na xrhsimopoieite ta proionta ths. Ta antikeimena perilambanoyn o,tidhpote - gia paradeigma h PostgreSQL, o xronos, h maza, h energeia, oi planhtes, o hlios, to feggari, ta asteria, oi galajies, oi an8rwpoi klp... einai antikeimena dhmioyrghmata ths episthmhs. Ayto to kefalaio perigrafei epishs pws oi nomoi ths episthmhs kai h statistikh eynooun ta systhmata open-source code opws h PostgreSQL kai to Linux. Ka8ws h taxuthta sto diadiktyo ayjanetai ka8hmerina, kai to diadiktyo ginetai oloena kai pio sta8ero, ta systhmata open-source code gnwrizoyn grhgorh anaptyjh. Kai an oi statistikoi kanones kai oi nomoi ths fysikhs einai swstoi, ta systhmata closed source-code 8a afanistoun telika apo ton planhth.

Oi paragrafoi poy akoloy8oun parakatw 8a sas deijoyn - ”poso aperanth einai h episthmh, poso shmantikh einai gia ton an8rwpo kai pws epidra se erga logismikou opws h PostgreSQL, to Linux”.

To na anaptujete ena project opws h PostgreSQL, apaitei energeia kai xrono, ara h PostgreSQL einai proion energeias kai xronoy. Mia kai h energeia kai o xronos mporoun na ejhgh8oun mono episthmonika, yparxei mia amfidromh sxesh metaju ths fysikhs kai twn ergwn logismikou opws h PostgreSQL, to Linux.

Oi episthmonikoi nomoi (Fysikh) efarmozontai pantou, synexeia, se o,ti kanete akomh kai sta erga logismikou opws systhmata basewn dedomenwn. H Fysikh efarmozetai akomh kai otan milate (hxhtika kumata), perpatate (tribh metaju edafoys kai pelmatos), diabazete ena biblio h grafete logismiko. Polloi kladoi ths episthmhs opws h fysikh, h xhmeia klp. sygxwneuontai se mia eyreia perioxh, ta Ma8hmatika (epishs gnwsta kai san th Basilissa olwn twn Episthmwn). Otidhpote se ayto ton kosmo exei ba8ies rizes sta ma8hmatika, symperilambanomenhs ths PostgreSQL. H PostgreSQL xrhsimopoiei th ’Monterna Algebra’ ,ena polu mikro parakladi twn ma8hmatikwn . H ’Monterna Algebra’ asxoleitai me th ’8ewria Synolwn’, th ’Sxesiakh Algebra’, episthmh twn Groups, Rings, Collections, Sets, Unions, Intersections, Exclusions, Domains, Lists, klp...

Logismiko opws h PostgreSQL yparxei shmera logw ths energeias kai toy xronoy. H energeia einai ayth poy dhmiourghse ton kosmo, ton an8rwpino egkefalo kai polla alla pragmata! H maza kai h energeia einai h IDIA ONTOTHTA! To gegonos oti h maza kai h energeia einai to idio pragma htan agnwsto stoys an8rwpoys 100 xronia prin!

Oi kyceles ston an8rwpino egkefalo katanalwnoyn energeia ka8ws epejergazontai (paragoyn logismiko) metatrepontas th xhmikh energeia se 8ermikh energeia. Akomh kai twra poy diabazete ayth thn paragrafo, oi kyceles ston egkefalo sas kaine benzinh kai xrhsimopoioun thn energeia. Gi’ ayto STAMATHSTE NA DIA-BAZETE TWRA! H energeia twn neyrwnwn (kyceles ston egkefalo) mporei na metrh8ei sta ergasthria. Gia paradeigma, yparxoyn polla organa opws oi ”Anixneytes Yematwn” kai alla iatrika organa poy mporoun na metrhsoyn thn energeia poy katanalwnei o egkefalos.

Ola ayta yponooun oti o an8rwpinos egkefalos einai mia 8ermodynamikh phgh energeias. Epeidh o an8rwpos einai mia 8ermodynamikh phgh energeias, oi nomoi ths 8ermodynamikhs efarmozontai ston egkefalo kai etsi h 8ermodynamikh exei emmesa apotelesmata se logismiko opws h PostgreSQL.

Opws se ka8e episthmh, einai adunato na xtisete opoiodhpote susthma h 8ewria (symperilambanomenoy enos systhmatos basewn dedomenwn) poy na einai 100 % teleio kai xwris sfalmata. Einai sa na kynhgate enan anemostrobilo , de 8a kataferoyme POTE na ftiajoyme to teleio susthma h 8ewria. Leptomereis ma8hmatikes ejiswseis/syzhthseis gia thn apodeijh ths uparjhs enos ’teleioy systhmatos’ einai adunato na ginoyn edw ka8ws jeperna to skopo aytou toy keimenoy.

Kai mia tetoia ma8hmatikh syzhthsh asxoleitai me ton apeiro ari8mo diastasewn poy yparxoyn sth fush. Dystyxws, oi an8rwpoi mporoun na doyn h na niwsoyn 4 diastaseis alla ta ma8hmatika mporoun na ejereynhsoyn eukola kai alles diastaseis.

Alles diastaseis einai ’apeira mikroteres’ apo ta atoma kai ta idia ta atoma einai me th seira toys polu mikra kai to an8rwpino mati de mporei na ta jexwrisei! Ta Ma8hmatika einai polu isxyra mia kai mporoun na analusoyn kai na ejhghsoyn th gennhsh/ 8anato olhs ths yfhlioy. O kosmos mas exei sxedon mhdeniko mege8os an ton koitajete apo allo sumpan kai antistrofa. Ayto shmainei oti o kosmos mas den einai oratos (den yparxei) gia ta atoma poy briskontai se allo sumpan. Kai antistrofa! 8ewrhtika, mporeite na bgeite apo ton kosmo mas kai na tajidecete megales apostaseis (disekatommuria eth fwtos) se elaxisto xrono kai na janampeite ston kosmo mas se ena diaforetiko shmeio toy xwroxronoy! H apostash metaju toy kosmoy mas kai twn allwn kosmwn einai pragmatika mhdenikos!

Akomh kai an yparxei apeiros ari8mos diastasewn, mporoun oles na prokucoyn/ dhmioyrgh8oun apo ena mikro ari8mo KYRIWN diastasewn. Apeiros ari8mos diastasewn mporoun na syndyastoun kai na katalhjoyn se kuries diastaseis. Oi kuries diastaseis apla aporrofoun tis alles diastaseis xwris aytes na katastrefontai. Oi ma8hmatikoi xrhsimopoioun aytes tis kuries diastaseis gia na katanohsoyn th gennhsh kai to 8anato toy sumpantos. O kosmos ston opoio zeite shmera dhmioyrgh8hke me to BIG BANG disekatommuria xronia prin (sxedon 20 disekatommuria xronia prin) to opoio dhmioyrgh8hke apo allhlepidraseis atomikwn swmatidiwn allwn diastasewn. Ligo prin to big bang yphrxe ena polu mikro shmeio opoy to mhkos, to platos kai to ucos htan MHDEN (dhladh, o kosmos mas den yphrxe ekei!!) enw yphrxe to ypoloipo sumpan kai oi kuries diastaseis. Ekeinh th xronikh stigmh den yphrxan atoma, asteria, planhtes kai galajies! Ta atoma mesa sto swma sas den yphrxan ekei! Exoyn ginei, loipon, tosa polla pragmata PRIN na gennh8eite!

To Big bang kai epomenws kai h gennhsh toy kosmoy mas proklh8hke apo liga atoma kuriwn diastasewn. KAPOIOS (kati;) prokalese th syntribh elaxistwn polu mikrwn atomwn allwn diastasewn me apotelesma th dhmioyrgia toy kosmoy mas, kai gennh8hkan nees diastaseis xronoy, mhkoys, platoys, ucoys ! Blepoyme to xeri kapoioy se ayth th diadikasia. Ayth h diadikasia den einai kai polu katanohth apo ton an8rwpo.

O an8rwpos prospa8ei na dhmioyrghsei enan allo kosmo sto ergasthrio prosomoiwnontas to gegonos big bang (brisketai ypo kataskeyh enas terastios epitaxynths sthn Eyrwph, allh mia kataskeyh sto Ntalas, h Amerikh stamathse logw perikopwn ston proupologismo). Yparxoyn atoma allwn diastasewn, opws exoyme ki emeis atoma ston diko mas kosmo. 8ewrhtika, mporeite na dhmioyrghsete/paragete apeiro ari8mo kosmwn! Ayth h diadikasia einai antistrepth, dhladh o kosmos mas mporei na syrriknw8ei se merika atoma allwn diastasewn! Einai paromoio me to na gennh8hkate apo duo mikroskopikes kyceles oi opoies 8a sygkroystoun gia na dhmioyrghsoyn mia mono kycelh. Ayth h monh mikroskopikh kycelida diaire8hke kai pollaplasiasthke se 6 trisekatommuria kycelides mexri na ginei enas an8rwpos ucoys 6 podia (dhladh eseis!). Yparxoyn merikes omoiothtes metaju an8rwpoy kai sumpantos, to sumpan gennietai kai argotera pe8ainei opws kai oi an8rwpoi. Mia kai einai adunath mia TELEIA katastash (opws kai h APOLYTWS MH TELEIA katastash), oi kosmoi san toys dikous mas genniountai kai pe8ainoyn argotera me mia kyklikh diadikasia. ALLA den yparxei TELEIOS 8anatos, mono metasxhmatismos epitrepetai apo thn episthmh! O kosmos mas megalwnei me taxutato ry8mo, den einai statikos, anti8eta einai polu dynamikos. Aytos o kosmos 8a synexisei na megalwnei wspoy na paremblh8ei kati poy 8a katastrecei ton kosmo mas efarmozontas dynameis me ejwterikes diastaseis poy 8a aporrofhsoyn kai 8a ejafanisoyn ton kosmo mas! Yparxoyn duo pi8anothtes - na apomakryn8ei h maza apo ton kosmo mas mesw twn maurwn trypwn (argh diadikasia), h na proste8ei kai allh maza ston kosmo mas mesw twn asprwn trypwn (grhgorh diadikasia megalhs sugkroyshs). Mporei na yparxoyn ekatommuria kosmoi alla ligoi einai aytoi poy dhmioyrgh8hkan apo kuries diastaseis. Den exete ftiaxtei mono apo atoma aytou toy kosmoy alla kai apo atoma allwn diastasewn! Stis maures trupes ta atoma kai ta swmatidia toy kosmoy mas menoyn egklwbismena kai metasxhmatizontai kai metatrepontai teleiws se swmatidia allwn diastasewn! Sto kentro mias maurhs trupas o xronos, to platos kai to ucos einai mhden! Kai h maurh trupa einai h porta E3ODOY/EISODOY pros kai apo alloys kosmoys. Portes EISODOY/E3ODOY pros alloys kosmoys mporoun na anoijoyn pantou, akomh kai mesa sto swma sas! Mporei na yparxei apeiros ari8mos xrwmatwn, glwsswn ypologisth, sxediwn tsip ypologisth kai 8ewries alla DEN MPOREI na yparjei ENA MONO TELEIO xrwma, glwssa ypologisth, sxedio h susthma! Ayto poy mporeite na exete einai mono ena SXEDON TELEIO xrwma (euros kumatos), susthma, bash dedomenwn h 8ewria! H fush einai opws ena Kaleidoskopio.

Syndyazontas thn energeia ekatommyriwn an8rwpwn se olo ton kosmo mesw internet, einai dynato na epiteyx8ei ena SXEDON TELEIO susthma (symperilambanomenoy enos systhmatos basewn dedomenwn). H energeia toy ka8e an8rwpoy atomika einai elaxisth, alla diasyndeontas ena megalo ari8mo an8rwpwn, h synolikh energeia 8a einai terastia gia na dhmioyrghsei ena sxedon teleio susthma. Oi an8rwpoi einai onta me periorismenh energeia kai apo8emata, kai polu syxna se aytous ofeilontai la8h apo apla mexri kai polu sobara. Epeidh h tash mas gia la8h poikillei se ka8e an8rwpo analoga me tis idiaiteres epidejiothtes, th sygkekrimenh empeiria poy exei o ka8enas kai tis sygkyries ths sygkekrimenhs stigmhs, h anakalych kai h elattwsh twn la8wn logismikou (bugs) poy dhmioyrgountai apo kapoio an8rwpo dieykolunetai me th sygkentrwsh pollwn ejypnwn an8rwpwn-myalwn gia na antimetwpisoyn to sygkekrimeno problhma. Perissotera atoma synepagetai perissoteres an8rwpowres gia kwdika kai thn antistoixh leitoyrgia toy.

Einai jeka8aro oti to internet mporei na diasyndesei ena terastio ari8mo an8rwpwn, opoy oloi mazi dia8etoyn polu energeia kai xrono. Me to syndyasmo toys mporoun na parax8oun proionta logismikou ychloterhs poiothtas se polu ligotero xrono se sugkrish me emporikes etaireies. Akomh kai megales etaireies opws h Microsoft, h IBM de mporoun na yperisxusoyn kai na agnohsoyn toys nomoys ths Fysikhs alla 8a YPOTAX8OYN telika se aytous!

Shmera, yparxoyn toses polles baseis dedomenwn se olo ton kosmo poy stoxeuoyn mono stis prodiagrafes ANSI/ISO SQL. Oi an8rwpoi den prepei na xaramizoyn to xrono toys gia na dhmioyrghsoyn tosa polla PAROMOIA/OLOIDIA paketa logismikou enw yparxoyn tosoi alloi tomeis ths episthmhs poy xreiazontai prosoxh. To symperasma einai to ejhs : ejaitias twn nomwn ths episthmhs, ta ’anoixta systhmata phgaioy kwdika’ opws h PostgreSQL, to Linux 8a einai panta polu kalutera apo ta ’kleista systhmata phgaioy kwdika’ kai ayto einai dynato na apodeixtei kai episthmonika.

4 Ti einai h PostgreSQL ;

H PostgreSQL ekdosh 6.4 einai mia dwrean bash, me thn opoia sas dinetai olos o phgaios kwdikas kai einai ena Susthma Antikeimenostrafhs-Sxesiakh Bashs Dedomenwn sxedon symbath me (plhsiazei olo kai perissotero) me to ANSI SQL1998,92,89 kai trexei se diaforetikes platformes hardware kai Leitoyrgika systhmata.

             Merikes fores bgainoyn se kykloforia ektaktes dior8wseis, mpalwmata (patches) gia dior8wseis
             la8wn meta thn ekdosh GA PostgreSQL. Mporeite na efarmosete ta proairetika patches
             analoga me tis anagkes ths efarmoghs sas. Akoloy8hste ta parakatw
             bhmata gia na efarmosete ta patches -
             Phgainete ston katalogo poy brisketai o kwdikas ths postgresql
                     cd /usr/src/postgresql6.3.1
                     patch -p0 < patchfile
                     make clean
                     make
             Deite epishs th selida boh8eias grafontas 'man patch'

Ta arxeia gia patch briskontai sto

   • PostgreSQL patches : <ftp://ftp.postgresql.org/pub/patches>

O apolytos skopos kai o telikos stoxos ths PostgreSQL einai ginei 100 % symbath me thn ANSI/ISO SQL kai na ginei epishs h noumero ENA Anoikth Genikh Bash ston kosmo. H PostgreSQL epishs 8a odhghsei, diey8unei, elegjei, parakoloy8hsei kai ypagoreusei to mellon ths ANSI/ISO SQL. Ayto giati, h ylopoihsh kai oi idees ginontai prwta sthn PostgreSQL kai epeita enswmatwnontai sthn ANSI/ISO SQL.

O Informix Universal server (ekdo8hke to 1997) basizetai se prohgoumenh ekdosh ths PostgreSQL epeidh h Informix agorase thn Illustra Inc. kai enopoih8hke me thn Informix. H bash Illustra htan plhrws basismenh sthn Postgres (prohgoumenh ekdosh ths PostgreSQL).

H PostgreSQL einai mia epektash toy systhmatos diaxeirishs ths bashs dedomenwn POSTGRES, ena epomenhs genias protypo ereynas DBMS. Enw h PostgreSQL diathrei to dynamiko montelo dedomenwn kai toys plousioys tupoys dedomenwn ths POSTGRES, antika8ista thn glwssa erwthsewn PostQuel me ena ektetameno yposunolo ths SQL.

H anaptyjh ths PostgreSQL ginetai apo mia omada programmatistwn sto Internet poy einai oloi grammenoi sth lista allhlografias anaptyjhs ths PostgreSQL. Syntonisths ths omadas einai o Marc G. Fournier

   • scrappy@postgreSQL.org

Ayth h omada einai ypeu8ynh gia olh thn trexoysa kai mellontikh anaptyjh ths PostgreSQL. Fysika, o idios o pelaths basewn dedomenwn einai aytos poy anaptussei thn PostgreSQL! To fortio ths anaptyjhs dianemetai se ena polu megalo ari8mo telikwn xrhstwn basewn sto internet.

Oi syggrafeis ths PostgreSQL 1.01 einai oi Andrew Yu kai Jolly Chen. Polloi alloi syneiseferan se ayth th metafora, to testarisma, thn aposfalmatwsh kai thn epektash toy kwdika. O arxikos kwdikas ths Postgres, ap’ opoy proekyce h PostgreSQL, htan h prospa8eia pollwn apofoitwn spoydastwn, metaptyxiakwn, kai proswpikou programmatistwn poy doulecan katw apo thn epiblech toy Ka8hghth Michael Stonebraker sto Panepisthmio ths Kalifornia, sto Berkeley.

To arxiko onoma toy logismikou sto Berkeley htan Postgres. Otan proste8hke h leitoyrgikothta gia SQL to 1995, to onoma allaje se Postgres95. To onoma allaje pali sto telos toy 1996 se PostgreSQL.

Ekatommuria PostgreSQL exoyn egkatasta8ei ws diakomistes basewn dedomenwn, Web database serverskai Application data servers. Einai polu proxwrhmenh, kai einai antikeimenostrafhs sxesiakh bash dedomenwn (ORDBMS).

H PostgreSQL mporei na apo8hkeusei perissoteroys tupoys dedomenwn apo toys paradosiakous tupoys dedomenwn opws integer, characters, klp. - mporeite na dhmioyrghsete toys dikous sas orismenoys tupoys, synarthseis, klhronomikothta klp. H PostgreSQL trexei se Solaris, SunOS, HPUX, AIX, Linux, Irix, Digital Unix, BSDi,NetBSD, FreeBSD, SCO unix, NEXTSTEP, Unixware kai se opoiodhpote tupo Unix. H metafora ths se Windows 95/NT einai se ejelijh.

• Titlos: PostgreSQL SQL RDBMS Database (Susthma Diaxeirishs Antikeimenostrafous Sxesiakhs Bashs Dedomenwn)

• Trexoysa ekdosh: 6.4

• Xronologia: H PostgreSQL einai 12 xronwn. Anaptussetai apo to 1985

• Syggrafeis: Anaptussetai apo ekatommuria/panepisthmia/etaireies sto internet gia ta teleytaia 12 xronia

H PostgreSQL kai ta sxetika kommatia toy keimenoy ypokeintai sthn parakatw PNEYMATIKH IDIOKTH-SIA.

     PostgreSQL Susthma Diaxeirishs Bashs Dedomenwn
     Pneymatikh Idiokthsia (c) toy panepisthmioy ths California
     Adeia gia xrhsh, antigrafh, metabolh, kai dianomh aytou toy logismiko kai ths
     tekmhriwshs toy gia opoiodhpote skopo, xwris telh, kai xwris grapth symfwnia
     parexetai, me thn proupo8esh oti to shmeiwma pneymatikhs idiokthsias kai
     ayth kai oi parakatw duo paragrafoi 8a emfanizontai se oles tis kopies.
     ME KANENAN TROPO, DEN 8A 8EWRH8EI TO PANEPISTHMIO THS KALIFORNIA NOMIKA YPEY8YNO
     GIA AMESH, EMMESH, EIDIKH, TYXAIA, H PARAGWMENH ZHMIA, SYMPERILAMANOMENHS KAI THS
     APWLEIAS KERDWN POY PROEKYYE APO THN XRHSH AYTOY TOY LOGISMIKOY KAI THS
     TEKMHRIWSHS TOY, AKOMA KAI AN TO PANEPISTHMIO THS KALIFONIA EXEI EIDOPOIH8EI GIA
     THN PI8ANOTHTA MIAS TETOIAS ZHMIAS.
     TO PANEPISTHMIO THS KALIFORNIA EIDIKA APARNEITAI KA8E EGGYSHSH, SYMPERILAMBANOMENHS,
     ALLA OXI PERIORISMENHS MONO SE AYTHN, THS YPONOOYMENHS EGGYHSHS XRHSHS, KAI XRHSHS
     GIA KAPOIO SYGKEKRIMENO SKOPO. TO LOGISMIKO POY PAREXETAI EDW EINAI SE BASH "WS EXEI"
     KAI TO PANEPISTHMIO THS KALIFORNIAS DEN EXEI YPOXREWSH GIA PAROXH SYNTHRHSHS, ENHMERWSEWN,
     EMPLOYTISMWN, H TROPOPOIHSEWN.

5 Pou mporw na th brw ;

Mporeite na agorasete to CDROM Redhat Linux, Debian Linux h to Slackware Linux poy periexoyn hdh thn Postgresql se morfh paketoy (kai o phgaios kwdikas kai ta ektelesima) apo ta :

• Linux System Labs Web site: <http://www.lsl.com/> 7 (U.S. dolaria)

• Cheap Bytes Inc Web site: <http://www.cheapbytes.com/> 7 (U.S. dolaria)

   • Debian Kentriko Web site : <http://www.debian.org/vendors.html>

O organismos PostgreSQL poyla epishs ena ’PostgreSQL CDROM’ poy periexei olon ton phgaio kwdika kai ektelesima gia polla leitoyrgika systhmata Unix kai plhrh tekmhriwsh.

• To CDROM ths PostgreSQL 8a to breite apo to kentriko Web site ths sto : <http://www.postgresql. org> gia 29 (Amerikanika dolaria)

Dianomh ths PostgreSQL mono me ektelesima:

• Mporeite na trejete thn PostgreSQL xwris na metaglwttisete ton kwdika. Egkatasthste ta ektelesima gia Intel-Linux apo to arxeio <ftp://www.redhat.com/pub/contrib/i386/> postgresql-6.4.i386.rpm. Ayto einai ena redhat ’rpm’ paketo kai periexei kai ton kwdika kai ta ektelesima gia thn PostgreSQL.

• Site me ektelesima gia Solaris, HPUX, AIX, IRIX, Linux : <ftp://ftp.postgresql.org/pub/ bindist> An metaglwttisete ton kwdika gia opoiadhpote platforma, parakalw steilte to sto site, mporei na einai xrhsimo gia toys ypoloipoys.

• ftp site : Parte ta ektelesima gia Intel-Linux apo to arxeio <ftp://ftp.redhat.com/pub/contrib/ i386/> postgresql-6.4.i386.rpm. Ayto einai ena redhat ’rpm’ paketo kai periexei kai ton kwdika kai ta ektelesima gia thn PostgreSQL.

WWW Web sites:

• Kentriko Web site: <http://www.postgresql.org/>
• Deutero Web site: <http://logical.thought.net/postgres95/>
• <http://www.itm.tu-clausthal.de/mirrors/postgres95/>
• <http://s2k-ftp.cs.berkeley.edu:8000/postgres95/>
• <http://xenium.pdi.net/PostgreSQL/>
• <http://s2k-ftp.cs.berkeley.edu:8000/postgres95/>

Ta ftp sites paroysiazontai parakatw :-

• Primary FTP: <ftp://ftp.postgresql.org/pub>
• Secondary FTP: <ftp://ftp.chicks.net/pub/postgresql>
• <ftp://ftp.emsi.priv.at/pub/postgres/>
• <ftp://ftp.itm.tu-clausthal.de/pub/mirrors/postgres95>
• <ftp://rocker.sch.bme.hu/pub/mirrors/postgreSQL>
• <ftp://ftp.jaist.ac.jp/pub/dbms/postgres95>
• <ftp://ftp.luga.or.at/pub/postgres95>
• <ftp://postgres95.vnet.net:/pub/postgres95>
• <ftp://ftpza.co.za/mirrors/postgres>
• <ftp://sunsite.auc.dk/pub/databases/postgresql>
• <ftp://ftp.task.gda.pl/pub/software/postgresql>
• <ftp://xenium.pdi.net/pub/PostgreSQL>

O phgaios kwdikas ths PostgreSQL einai epishs dia8esimos se ola ta mirror sites toy sunsite unc (sunolo peripoy 1000 sites se olo ton kosmo). Brisketai epishs sth dianomh toy Red Hat Linux sto arxeio /pub/contrib/i386/postgresql.rpm .

• Gia th lista twn mirror sites phgainete sto <ftp://sunsite.unc.edu>

6 H PostgreSQL yposthrizei ejairetika megales baseis, megaluteres apo 200 Gig

H apodosh twn 32-bit mhxanwn cpu 8a pesei grhgora otan to mege8os ths bashs jeperasei ta 5 gig. Mporeite na trejete bash twn 30 gig se mia 32-bit cpu alla h apodosh de 8a einai kai polu entypwsiakh. Yparxoyn periorismoi poy epiballontai apo to mege8os ths mnhmhs RAM (megisto 2 gig mono), periorismoi apo ta mege8h toy systhmatos arxeiwn kai epishs apo to leitoyrgiko susthma.

An xreiazetai na xrhsimopoihsete ejairetika megales baseis, sas symboyleuoyme na xrhsimopoihsete mhxanes twn 64-bit opws Digital Alpha cpu, Sun Ultra-sparc 64-bit cpu, Silicon graphics 64-bit cpu, Intel Merced IA-64 cpu, mhxanes HPUX 64bit, IBM 64-bit. Metaglwttiste thn PostgreSQL se mia 64-bit cpu kai 8a mporei na yposthrizei terasties baseis kai megala queries. H apodosh ths PostgreSQL gia erwthseis se megaloys pinakes kai baseis 8a einai polles fores taxuterh apo thn PostgreSQL se mhxanes me cpu 32-bit. To pleonekthma twn mhxanwn 64-bit einai oti h deiktodothsh toy xwroy mnhmhs einai polu megalh kai to leitoyrgiko susthma mporei na yposthrijei systhmata megalwn arxeiwn, parexei kaluterh apodosh me megales baseis, yposthrizei polu perissoterh mnhmh (RAM), exoyn perissoteres dynatothtes klp.

7 Pws mporw na empistey8w thn PostgreSQL ; To paketo Regression gia test anaptussei to ais8hma empistosunhs ston pelath

To paketo Regression gia test (src/test/regress) perilambanetai sth dianomh kai afhste ton ypologisth sas na epalh8eusei tis stantar leitoyrgies SQL kai tis dynatothtes epektashs ths PostgreSQL. To paketo gia test periexei hdh ekatontades SQL test programmata.

8a prepei na xrhsimopoihsete th dunamh toy ypologisth gia na elegjete thn PostgreSQL, anti na xrhsimopoihsete th dunamh toy an8rwpinoy egkefaloy. Oi ypologistes mporoun na ektelesoyn test gia to logismiko regression ekatommuria h akomh kai disekatommuria fores grhgorotera apo oti oi an8rwpoi.

Sto prosexes mellon h taxuthta twn ypologistwn 8a einai arketa trisekatommuria fores grhgoroteroi apo ton an8rwpino egkefalo!

Etsi, exei nohma na xrhsimopoihsoyme th dunamh toy ypologisth gia na elegxoyme logismiko.

Mporeite na pros8esete kai alla test se periptwsh poy to xreiazeste, kai mporeite na ta steilete sto kentriko web site ths PostgreSQL an nomizete oti 8a einai xrhsimo se alloys sto internet. To paketo Regression gia test enisxuei thn empistosunh toy pelath sthn PostgreSQL kai eykolunei th grhgorh efarmogh ths PostgreSQL se systhmata paragwghs.

To paketo Regression gia test mporei na 8ewrh8ei san ena ”POLY STA8ERO” texniko keimeno symfwnhmeno amoibaia metaju twn programmatistwn kai twn telikwn xrhstwn. Oi programmatistes ths PostgreSQL xrhsimopoioun ektetamena to paketo regression gia test kata thn periodo ths anaptyjhs kai epishs prin thn ekdosh toy logismikou sto koino gia na diasfalisoyn thn kalh poiothta.

Oi dynatothtes ths PostgreSQL antikatroptizontai sto paketo gia test regression. Se periptwsh poy mia dynatothta, suntajh h xarakthristiko den perilambanetai sto paketo den shmainei pws kaluptetai anagkastika apo thn PostgreSQL. Mporeite na to elegjete, parola ayta, eseis kai na enswmatwsete to test sas sto paketo.

8 Grafiko programma epikoinwnias (GUI FrontEnd Tool) me thn PostgreSQL

H dianomh ths PostgreSQL perilambanei mia biblio8hkh se Tcl/Tk, poy onomazetai ’pgTcl’. H Tcl/Tk einai ena ergaleio gia grhgorh anaptyjh efarmogwn kai mia polu dynath scripting glwssa. Anaptussete mia fora thn efarmogh sas kai thn trexete pantou : se NT, Win 95, Linux, OS/2 kai ola ta systhmata unix. Tcl einai ta arxika toy ’Tool Command Language’ kai Tk toy ’Tool Kit’. Yparxei ena oloklhrwmeno periballon anaptyjhs (IDE - integrated development environment) gia thn Tcl/Tk poy legetai SpecTcl. Koitajte gi ayto to rpm paketo sth dianomh Redhat linux h sto sunscript site poy dinetai parakatw.

Synistoume thn Perl gia glwssa programmatismou mia kai einai h pio diadedomenh glwssa, polu isxyrh kai diati8etai gia ola ta mhxanhmata kai oles tis platformes leitoyrgikwn. Sas symboyleuoyme na xrhsimopoihsete Perl-Tk h Perl-Qt h C++ QtEZ h C++ Lesstiff. O syndyasmos Perl, C kai Tk 8a ikanopoihsei tis anagkes twn perissoterwn projects, lambanontas ypoch to dia8esimo xrono, thn taxuthta twn ektelesimwn kai thn eykolia programmatismou. Shmeiwste oti ta programmata se Java trexoyn polu arga. Akomh kai ta programmata poy einai grammena se C++ trexoyn pio arga apo ta programmata poy grafontai se C. Ta programmata se C ektelountai taxutera apo ta antistoixa programmata grammena se opoiadhpote allh glwssa programmatismou.

H Perl xrhsimopoieitai gia ton programmatismo toy 90 % twn internet scripts ston kosmo. Etsi 8a exete mono mia glwssa, thn ”Perl”, gia oles sas tis anagkes, se efarmoges oso kai sto internet. Deite to Perl Database Interface aytou toy keimenoy sto 11 ()

8a prepei na melethsete ta dynata shmeia ths Perl se sugkrish me thn Tcl/Tk prin jekinhsete kapoio project se Tcl. H Tcl/TK dinetai synh8ws me ka8e linux cdrom. Mporeite epishs na th breite sta sites -

   • Tcl/Tk <http://www.scriptics.com>

• Antikeimenostrafes extension ths Tcl poy onomazetai INCR sto <http://www.tcltk.com>

   • Visual TCL site <http://www.neuron.com>
   • Visual TCL Redhat rpm sto <ftp://ftp.redhat.com/pub/contrib/i386/visualtcl*.rpm>
   • <http://sunscript.sun.com/>
   • <http://sunscript.sun.com/TclTkCore/>
   • <ftp://ftp.sunlabs.com/pub/tcl/tcl8.0a2.tar.Z>

• Biblia anaforwn: Polla texnika biblia gia TCL/TK diati8entai sthn agora.

9 Ergaleia enos Oloklhrwmenoy Systhmatos Anaptyjhs gia PostgreSQL (GUI IDE)

Koitajte ta parakatw ergaleia anaptyjhs ta opoia mporeite na xrhsimopoihsete se syndyasmo me odhgous ODBC/JDBC. Aytoi einai paromoioi me Borland C++ Builder, Borland JBuilder.

To Vibe einai Java kai C++ IDE (Integrated Development Environment) kai kerdise sthn Unix Episkophsh gia ta oloklhrwmena systhmata anaptyjhs ths xronias.

   • Perissoteres plhrofories gia to Vibe sto <http://www.LinuxMall.com/products/00487.html>

• To ’QT’ einai mia platforma anaptyjhs efarmogwn gia Windows95/NT kai Unix <http://www.troll.

     no> kai to ftp site toy einai to <ftp://ftp.troll.no>

Mporeite epishs na xrhsimopoihsete Borland C++ Builder, Delphi, Borland JBuilder, PowerBuilder se Windows95 kai na synde8eite me thn PostgreSQL se ena susthma unix mesw odhgwn ODBC/JDBC.

Deite epishs to PERL Database Interface se ayto to keimeno sto 11 () H Perl kai C/C++ synistantai entona san epiloges glwssas gia IDE.

Dwrean ergaleia IDE -

Deite to CDROM ths dianomhs redhat linux.

• Lesstiff Mottif Tool <ftp://ftp.redhat.com/pub/contrib/i386/lesstiff*.rpm>
• FreeBuilder <ftp://ftp.redhat.com/pub/contrib/i386/free*.rpm>
• SpecTCL <ftp://ftp.redhat.com/pub/contrib/i386/spec*.rpm>
• JccWarrior <ftp://ftp.redhat.com/pub/contrib/i386/jcc*.rpm>
• Kanchenjunga Java RAD Tool for PostgreSQL <http://www.man.ac.uk/~whaley/kj/kanch.html>
• Applixware Tool <http://www.redhat.com>
• XWPE X Windows Programming Environment <http://www.rpi.edu/~payned/xwpe/>  <ftp://
  ftp.redhat.com/pub/contrib/i386/xwpe*.rpm>
• XWB X Windows Work Bench <ftp://ftp.redhat.com/pub/contrib/i386/xwb*.rpm>
• NEdit <ftp://ftp.redhat.com/pub/contrib/i386/nedit*.rpm>

10 Odhgoi Diasundeshs me thn PostgreSQL

10.1 ODBC Drivers gia thn PostgreSQL

ODBC einai akrwnumio toy ’Open DataBase Connectivity’, ena dhmofiles protypo gia prosbash se plhrofories apo diafores baseis apo diaforetikous pwlhtes. Oi efarmoges poy exoyn graftei xrhsimopoiwntas ODBC drivers, eggyountai oti 8a doylecoyn me diafores baseis opws PostgreSQL, Oracle, Sybase, Informix klp.

• To PostODBC exei symperilhf8ei hdh sth dianomh. Deite to kentriko web site <http://www. postgresql.org>. Symperilambanetai sto CDROM ths PostgreSQL.

• <http://www.openlinksw.com> H Open Link Software Corporation poylaei ODBC gia PostgreSQL kai alles baseis. H Open Link dinei epishs dwrean ODBC (periorismeno ari8mo xrhstwn) - tsekarete to.

• Insight ODBC gia thn PostgreSQL <http://www.insightdist.com/psqlodbc> Ayto einai to epishmo site toy PostODBC.

Yparxei kapoio ergo poy onomazetai FreeODBC Pack Package. Den yparxei s’ ayto ekdosh gia PostgreSQL, isws mporeite na boh8hsete.

• <http://www.ids.net/~bjepson/freeODBC/> Ayth einai h dwrean ekdosh gia ODBC.

10.2 UDBC Drivers gia thn PostgreSQL

To UDBC einai mia statikh ekdosh ODBC anejarthth apo diaxeiristes odhgwn (driver managers) kai yposthrijh DLL, xrhsimopoieitai gia na pros8etei yposthrijh apey8eias diasundeshs me bash mesa stis efarmoges.

• <http://www.openlinksw.com>H etaireia Open Link Software poyla UDBC gia thn PostgreSQL kai alles baseis. H Open Link dinei epishs dwrean UDBC (periorismeno ari8mo xrhstwn) - tsekarete to.

10.3 JDBC Drivers gia thn PostgreSQL

JDBC einai akrwnumio toy ’Java DataBase Connectivity’. H Java einai mia glwssa programmatismou anejarthtoy platformas poy anaptux8hke apo thn Sun Microsystems. Oi programmatistes Java en8arrunontai na grafoyn efarmoges basewn dedomenwn xrhsimopoiwntas JDBC gia na dieykolunoyn th metafersimothta metaju basewn opws h PostgreSQL, Oracle, informix, klp. An gracete efarmogh se Java mporeite na parete toys odhgous JDBC gia PostgreSQL apo ta parakatw sites:

O odhgos JDBC perilambanetai hdh sth dianomh ths PostgreSQL.

   • <http://www.demon.co.uk/finder/postgres/index.html> Diasundesh Java (ths Sun) me Post-

greSQL

   • <ftp://ftp.ai.mit.edu/people/rst/rst-jdbc.tar.gz>

• <http://www.openlinksw.com> H etaireia Open Link Software poyla JDBC gia PostgreSQL kai alles baseis. H Open Link dinei epishs dwrean JDBC (periorismeno ari8mo xrhstwn) - tsekarete to.

   • JDBC UK site <http://www.retep.org.uk/postgres>
   • JDBC FAQ site <http://eagle.eku.edu/tools/jdbc/faq.html>

Ta JDBC home, guide kai FAQ briskontai sta -

   • JDBC HOME <http://splash.javasoft.com/jdbc>
   • JDBC guide <http://www.javasoft.com/products/jdk/1.1/docs/guide/jdbc>
   • JDBC FAQ <http://javanese.yoyoweb.com/JDBC/FAQ.txt>

10.4 Java gia PostgreSQL

Oi programmatistes Java mporei na 8ewrhsoyn ta parakatw sites polu xrhsima gia thn PostgreSQL.

   • <ftp://ftp.redhat.com/pub/contrib/i386> kai deite to postgresql-jdbc-*.rpm
   • <http://www.blackdown.org>

11 Perl Database Interface (DBI) Driver gia PostgreSQL

11.1 Diasundesh Perl 5 me PostgreSQL

PERL einai akrwnumio toy ’Practical Extraction kai Report Language’. H Perl einai dia8esimh sxedon se ka8e leitoyrgiko kai platforma hardware. Mporeite na xrhsimopoihste Perl se Windows95/NT, ola ta Unix (Solaris, HPUX, AIX, Linux, Irix, SCO klp.), se mainframe MVS, desktop OS/2, OS/400, Amdahl UTS kai polla alla. H Perl trexei AKOMH kai se polla mh dhmofilh/genika agnwsta leitoyrgika systhmata kai ylika!! Etsi, mhn ekplageite an deite thn perl na trexei se polla oxi syxna xrhsimopoioumena leitoyrgika. Mporeite na fantasteite thn terastia bash xrhstwn kai programmatistwn se Perl. H diasundesh Perl me PostgreSQL perilambanetai sth dianomh ths PostgreSQL. Koitajte ston katalogo src/pgsql perl5.

• To Email gia epikoinwnia sxetika me thn Pgsql perl5 : E.Mergl@bawue.de

• Allh phgh einai ta - <ftp://ftp.kciLink.com/pub/PostgresPerl-1.3.tar.gz>
• Perl Home page: <http://www.perl.com/perl/index.html>

• Ekma8hsh ths Perl, cajte gia titlo Tutorial sto : <http://reference.perl.com/>

• To Perl FAQ einai sto :  <http://www.yahoo.com/Computers_and_Internet/Programming_
  Languages/Perl/>

• Grafiko periballon gia Perl, Perl-Qt : <ftp://ftp.redhat.com/pub/contrib/i386> kai cajte gia to PerlQt-1.06-1.i386.rpm

• Grafiko periballon gia Perl, Perl-Qt : <http://www.accessone.com/~jql/perlqt.html>

• Grafiko periballon gia Perl, Perl-XForms : <ftp://ftp.redhat.com/pub/contrib/i386> kai cajte gia to arxeio Xforms4Perl-0.8.4-1.i386.rpm

• Grafiko periballon gia Perl, Perl-Tk : <ftp://ftp.redhat.com/pub/contrib/i386>
• Perl GUIkits : <http://reference.perl.com/query.cgi?ui>
• Perl Database Interfaces : <http://reference.perl.com/query.cgi?database>
• Metafrasths apo Perl se ”C” : <http://www.perl.com/CPAN-local/modules/by-module/B/> kai

cajte gia to Compiler-a3.tar.gz

• Metafrasths apo Perl se kelyfos Bourne : <http://www.perl.com/CPAN/authors/id/MERLYN/
  sh2perl-0.02.tar.gz>

• apo awk se perl a2p kai apo sed se perl s2p perilambanetai me th dianomh ths PERl.

• Deite epishs ta newsgroups gia PERL sto comp.lang.perl.*

11.2 Perl Database Interface DBI

11.2.1 TI EINAI TO DBI ; To parakatw einai apospasma apo thn kentrikh selida toy Perl DBI. To Perl Database Interface (DBI) einai ena programmatistiko interface (API) se Perl gia diasundesh me baseis dedomenwn. Oi prosdiorismoi toy Perl DBI API orizoyn ena sunolo apo roytines, metablhtes kai symbaseis poy parexoyn ena synektiko interface bashs dedomenwn anejarthto apo thn pragmatikh bash poy xrhsimopoieitai. Oi plhrofories gia ayto to tmhma DBI prohl8e apo to keimeno ’DBI FAQ’ to opoio exei gracei o Alligator Descartes to anaparagagame me thn adeia toy.

• Mporeite na epikoinwnhsete me ton Alligator Descartes Hermetica sto descarte@hermetica.com 11.2.2 Odhgos DBI gia thn PostgreSQL - DBD-Pg-0.89 Katebaste to DBD-Pg-0.89.tar.gz apo ta

   • DBD-Pg-0.89 : <http://www.perl.com/CPAN/modules/by-module/DBD/>

• Comprehensive Perl Archive Network CPAN <http://www.perl.com/CPAN>

   • Lista odhgwn DBI kai selides DBI module <http://www.hermetica.com/technologia/perl/DBI>

• Plhrofories gia to DBI 8a breite sto <http://www.fugue.com/dbi/>

   • Kentriko ftp site <ftp://ftp.demon.co.uk/pub/perl/db>
   • Diafora DBI link <http://www-ccs.cs.umass.edu/db.html>
   • Diafora DBI link <http://www.odmg.org/odmg93/updates_dbarry.html>
   • Diafora DBI link <http://www.jcc.com/sql_stnd.html>
   • H bash PostgreSQL <http://www.postgresql.org>

APAITHSEIS:

• - na xtisete, na testarete kai na egkatasthsete thn Perl 5 (toylaxiston thn 5.002)

• - na xtisete, na testarete kai na egkatasthsete to module DBI (toylaxiston to 0.89)

• - na xtisete, na testarete kai na egkatasthsete thn PostgreSQL (toylaxiston thn 6.2)

11.2.3 Texnikh yposthrijh gia to DBI Parakalw steilte ta sxolia sas kai anafores la8wn sto

   • E.Mergl@bawue.de

Symperilabete parakalw thn ejodo ths entolh perl -v, kai perl -V, thn ekdosh ths PostgreSQL, thn ekdosh toy DBD-Pg, kai thn ekdosh toy DBI sthn anafora la8wn.

11.2.4 Ti einai ta DBI, DBperl, Oraperl kai *perl; Opws eipe kai o Tim Bunce, o sxediasths kai syggrafeas toy DBI: “To DBI einai ena programmatistiko interface (API) se Perl gia diasundesh me diasundesh me baseis dedomenwn. Oi prosdiorismoi toy DBI API orizoyn ena sunolo apo roytines, metablhtes kai symbaseis poy parexoyn ena synektiko interface bashs dedomenwn anejarthto apo thn pragmatikh bash poy xrhsimopoieitai.” Me apla logia, to DBI interface epitrepei stoys xrhstes na exoyn diafanh prosbash se pollaplous tupoys basewn. Etsi, an syndeeste thn Oracle, Informix, mSQL, Sybase h opoiadhpote allh bash, de xreiazetai na gnwrizete toys ypokeimenoys mhxanismous toy epipedoy 3GL. To API poy orizetai apo to DBI 8a doylecei se oloys toys tupoys basewn. Ena paromoio pleonekthma einai h ikanothta na synde8eite se duo baseis diaforetikou tupoy mesw toy idioy perl script, px, 8elete na diabasete dedomena apo mia bash Oracle kai na ta eisagete se mia bash Informix mesa sto idio programma. To epipedo DBI sas epitrepei na to kanete ayto apla kai isxyra.

DBperl einai to palio onoma gia tis prodiagrafes toy interface. Xrhsimopoieitai synh8ws gia na ypodhlwsei ta perl4 modules gia diasundesh me baseis, opws, oraperl, isqlperl, ingperl kai loipa. Ayta ta interfaces den eixan stantar API kai genika den yposthrizontai.

Na mia lista apo DBperl modules, to antistoixo DBI tairi toys kai plhrofories yposthrijhs. Erwthseis sxetika me ton odhgo DBI 8a prepei na apey8unontai sth lista allhlografias dbi-users .

         Onoma Module Apaitoumenh Bash     Syggrafeas          DBI
         ------------ -----------------   ----------          ---
         Sybperl     Sybase              Michael Peppler     DBD::Sybase
                                         <mpeppler@datamig.com>
                                         http://www.mbay.net/~mpeppler
         Oraperl     Oracle 6 & 7        Kevin Stock         DBD::Oracle
                                         <dbi-users@fugue.com>
         Ingperl     Ingres              Tim Bunce &         DBD::Ingres
                                         Ted Lemon
                                         <dbi-users@fugue.com>
         Interperl   Interbase           Buzz Moschetti      DBD::Interbase
                                         <buzz@bear.com>
         Uniperl     Unify 5.0           Rick Wargo          -
                                         <rickers@coe.drexel.edu>
         Pgperl      Postgres            Igor Metz           DBD::Pg
                                         <metz@iam.unibe.ch>
         Btreeperl   NDBM                John Conover        SDBM;
                                         <john@johncon.com>
         Ctreeperl   C-Tree              John Conover        -
                                         <john@johncon.com>
         Cisamperl   Informix C-ISAM     Mathias Koerber     -
                                         <mathias@unicorn.swi.com.sg>
         Duaperl     X.500 Directory     Eric Douglas        -
                     User Agent

Parola ayta, merika DBI modules exoyn epipeda prosomoiwshs DBperl. Etsi, h DBD::Oracle erxetai me ena epipedo prosomoiwshs Oraperl, poy sas epitrepei na trejete klhronomika oraperl scripts xwris allages. To epipedo prosomoiwshs metafrazei tis klhseis toy oraperl API se klhseis DBI kai tis ektelei mesw toy DBI switch.

Na enas pinakas me plhrofories gia ta epipeda prosomoiwshs :

         Module          Epipedo prosomoiwshs      Katastash
         ------          ---------------------     ------
         DBD::Oracle     Oraperl                   Oloklhrwmeno
         DBD::Informix   Isqlperl                  Ypo anaptyjh
         DBD::Sybase     Sybperl                   Doyleuei; (xreiazetai epalh8eysh )
         DBD::mSQL       Msqlperl                  Ekdo8hke peiramatika me thn
                                                   DBD::mSQL-0.61

H prosomoiwsh Msqlperl einai mia eidikh periptwsh. To Msqlperl einai enas odhgos perl5 gia mSQL baseis, alla de symmorfwnetai me tis prodiagrafes toy DBI. H xrhsh apodokimazetai rhta gia xarh toy DBD::mSQL. Mporeite na katebasete thn Msqlperl apo th CPAN apo to:

   • <http://www.perl.com/cgi-bin/cpan_mod?module=Msqlperl>

11.2.5 Prodiagrafes DBI

Yparxoyn liges phges plhroforias gia DBI.

   • Prodiagrafes DBI <http://www.hermetica.com/technologia/perl/DBI/doc/dbispec>

Yparxoyn duo prodiagrafes dia8esimes se ayto to link, oi nees Proxeires (Draft) DBI prodiagrafes, ayto to keimeno allazei ka8hmerina ka8ws h omada anaptyjhs badizei oros ena sta8ero interface, kai oi palies istorikes DBperl prodiagrafes apo tis opoies anaptux8hke to trexon DBI interface.

To teleytaio keimeno prepei na diabastei mono kai mono apo istoriko endiaferon kai na mh xrhsimopoih8ei ws egxeiridio programmatismou, h ws egkyro me opoiadhpote ennoia. Parola ayta, paramenei mia akomh xrhsimh phgh anaforas.

Tekmhriwsh POD Ta PODs einai kommatia tekmhriwshs poy enswmatwnontai synh8ws se programmata perl poy tekmhriwnoyn ton kwdika “in place”, parexontas ena xrhsimo boh8hma gia programmatistes kai xrhstes modules. To POD gia DBI kai drivers ginetai olo kai perissotero koinotopo, kai h tekmhriwsh gia ayta ta modules mporei na diabastei me tis parakatw entoles.

Prodiagrafes DBI Ta POD gia prodiagrafes DBI mporei na diabastei me thn entolh:

perldoc DBI

Oraperl Oi xrhstes toy epipedoy prosomoiwshs Oraperl poy erxetai mazi me thn DBD::Oracle, mporoun na synexisoyn na diabasoyn gia to pws na programmatisoyn me to Oraperl plhktrologwntas:

perldoc Oraperl

Ayto 8a paragei ena enhmerwmeno antigrafo ths arxikhs selidas boh8eias oraperl, poy grafthke apo ton Kevin Stock gia perl4. To API ths oraperl emfanizetai kai perigrafetai ekei plhrws.

DBD::mSQL Oi xrhstes toy DBD::mSQL module mporoun na diabasoyn gia merikes private functions kai idiomorfies aytou toy odhgou (driver) plhktrologwntas:

perldoc DBD::mSQL

Syxna Diatypwmenes Erwthseis (FAQ)

To keimeno, Frequently Asked Questions einai epishs dia8esimo ws tekmhriwsh se POD ! Mporeite na to diabasete sto diko sas susthma, plhktrologwntas:

perldoc DBI::FAQ

Ayto mporei na einai bolikotero gia an8rwpoys poy den einai syndedemenoi monima h aneta, sto Internet.

To POD genika Plhroforhsh gia th syggrafh POD, kai gia thn filosofia toy POD genikotera, mporei na diabastei grafontas:

perldoc perlpod

Xrhstes poy exoyn egkatasthsei to Tk module isws na endiaferontai na ma8oyn pws yparxei dia8esimos enas POD anagnwsths basismenos se Tk poy legetai tkpod, kai diamorfwnei POD se mia bolikh kai anagnwsimh morfh.

“Periplanhseis”, “Mezedakia” kai Parathrhseis Yparxei mia seira apo peristasiakes “periplanhseis” apo diaforoys stis listes allhlografias gia DBI.

   • <http://www.hermetica.com/technologia/perl/DBI/tidbits>

“DBI – The perl5 Database Interface” Ayto einai ena ar8ro apo ton Alligator Descartes kai ton Tim Bunce gia th domh toy DBI. Dhmosieuthke sto teuxos 5 toy “The Perl Journal”. Einai yperbolika kalo. Phgainete kai agoraste to periodiko. Edw poy ta leme, agoraste ola ta teuxh! “The Perl Journal”s WWW site is:

   • <http://www.tpj.com>

“DBperl” Ayto to ar8ro, to opoio dhmosieuthke sthn ekdosh Noembrioy toy 1996 “Dr. Dobbs Journal” asxoleitai me DBperl.

“The Perl5 Database Interface” Ayto einai ena biblio grammeno apo ton Alligator Descartes kai ekdo8hke apo toys O’Reilly kai Associates.

Listes Allhlografias yparxoyn treis listes allhlografias gia DBI poy diaxeirizetai o Ted Lemon. Se oles mporeite na grafteite kai na jegrafteite apo to World Wide Web sth dieu8ynsh :

   • Listes allhlografias <http://www.fugue.com/dbi>

Oi listes stis opoies mporoun na symmetexoyn oi xrhstes einai:

dbi-announce Ayth h lista allhlografias mono gia anakoinwseis. An den mporeite na xrhsimopoihsete thn forma ths parapanw WWW selidas, eggrafeite sth lista me ton akoloy8o tropo:

   • Email: dbi-announce-request@fugue.com

me keimeno sto swma (body) toy mhnumatos ’subscribe’

dbi-dev H lista ayth stoxeuei se xrhsh apo toys programmatistes poy kanoyn anaptyjh, poy syzhtane idees kai ennoies gia ta twn DBI interface, API kai driver. An den mporeite na xrhsimopoihsete thn forma ths parapanw WWW selidas, eggrafeite sth lista me ton akoloy8o tropo:

   • Email: dbi-dev-request@fugue.com

me keimeno sto swma (body) toy mhnumatos ’subscribe’

dbi-users Ayth h lista allhlografias einai mia lista genikwn syzhthsewn poy xrhsimopoieitai gia anafores sfalmatwn, syzhthsh problhmatwn kai genikes anazhthseis. An den mporeite na xrhsimopoihsete thn forma ths parapanw WWW selidas, eggrafeite sth lista me ton akoloy8o tropo:

   • Email: dbi-users-request@fugue.com

me keimeno sto swma (body) toy mhnumatos ’subscribe’

Xronika/Arxeia twn Listwn Allhlografias

   • Amerikanika Arxeia Listwn Allhlografias  <http://outside.organic.com/mail-archives/
     dbi-users/>
   • Eyrwpaika Arxeia Listwn Allhlografias <http://www.rosat.mpe-garching.mpg.de/mailing-lists/
     PerlDB-Interest>

11.2.6 Problhmata Metaglwttishs h alliws ”Kophke stis Ejetaseis!”

An exete core dump, dokimaste to module Devel::CoreStack gia na dhmioyrghsete ena stack trace apo to core dump. To Devel::CoreStack brisketai sto CPAN sto:

   • <http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack>

Steilte Email sth lista dbi-users to stack trace, thn ekdosh twn modules, ths perl, ta test poy kanate, thn ekdosh toy leitoyrgikou systhmatos kai opoies alles sxetikes plhrofories. Oses perissoteres plhrofories steilete, toso grhgorotera 8a anixneusoyn oi programmatistes ta problhmata. An de mas steilte tipota, tote mhn perimenete tipota kai apo emas.

–> 11.2.7 Yposthrizetai to DBI katw apo platformes Windows 95 / NT ;

H metafora twn DBI kai DBD::Oracle Win32 einai twra ena stantar tmhma toy DBI, etsi, an katebasete ekdosh toy DBI megaluterh toy 0.81 8a prepei na doyleuei mia xara. Mporeite na exete prosbash stis baseis Microsoft Access kai SQL-Server apo to DBI mesw ODBC. Mazi me to DBI-0.79 (kai metepeita) dinetai ena peiramatiko DBI ’epipedo prosomoiwshs’ gia to module Win32::ODBC. Onomazetai DBI::W32ODBC. 8a xreiasteite to module Win32::ODBC.

   • Win32 DBI <http://www.hermetica.com/technologia/perl/DBI/win32>
   • Win32 ODBC <http://www.roth.net>

11.2.8 Ti einai to DBM; Kai giati 8a prepei na xrhsimopoiw to DBI sth 8esh toy;

To UNIX eylogh8hke apo thn arxh me aples “baseis” basismenes se epipeda arxeia, gnwstes san susthma dbm. To dbm sas epitrepei na apo8hkeuete dedomena se arxeia, kai na anaktate ta dedomena grhgora Parolayta, ayto exei kai sobara meionekthmata.

Kleidwma Arxeiwn (File Locking)

Ta systhmata dbm den pareixan idiaitera isxyres dynatothtes gia kleidwma arxeiwn, oute kamia ikanothta gia th dior8wsh problhmatwn poy proekyptan apo taytoxrones eggrafes [sth bash].

Ay8airetes Domes Dedomenwn (Arbitrary Data Structures)

Ta systhmata dbm epitrepoyn mono mia sta8erh domh dedomenwn: zeygaria kleidiwn-timwn (key-value pairs). Ayth h timh mporei na einai ena sun8eto antikeimeno, opws ena [ C ] struct, alla to kleidi prepei na einai monadiko. Ayto htan megalos periorismos sth xrhsimothta twn systhmatwn dbm.

Parolayta, ta systhmata dbm akoma einai xrhsima gia xrhstes me apla sunola dedomenwn kai periorismenoys poroys, mia kai einai grhgora, dynata kai ejairetika kala elegmena. Ta modules ths Perl gia thn prosbash se systhmata dbm exoyn enswmatw8ei twra sthn dianomh ths, mesw toy module AnyDBM File.

Perilhptika, to DBM einai mia ikanopoihtikotath lush gia (kata kanona) read-only baseis, h mikra kai apla sunola dedomenwn. Parolayta, gia perissotero isxyra kai epektasima sunola dedomenwn, xwris oute kan na anafer8oume kai se ajiopisto transactional locking, synistoume stoys xrhstes na xrhsimopoihsoyn DBI.

11.2.9 Yposthrizetai < to tade xarakthristiko > sto DBI;

8ewrwntas oti to xarakthristiko poy zhthsate einai ena mh-stantar, ejartwmeno apo kapoia sygkekrimenh bash, xarakthristiko, tote h apanthsh einai oxi.

To DBI antanakla ena geniko API poy 8a doylecei gia tis perissoteres baseis, kai den parexei kamia epipleon leitoyrgikothta gia kapoia sygkekrimenh bash dedomenwn (database-specific functionality).

Parolayta, oi syggrafeis twn odhgwn mporoun, an to epi8ymoun, na symperilaboyn hooks pros ejeidikeymenes leitoyrgies/xarakthristika kapoias bashs dedomenwn mesw ths me8odoy func poy orizetai sto DBI API. Osoi anaptussoyn scripts 8a prepei na shmeiwsoyn pws h leitoyrgikothta poy parexetai mesw twn me8odwn func einai api8ano na metafer8ei se alles baseis.

11.2.10 Xrhsimeuei ka8oloy to DBI gia programmatismo se CGI;

Me mia lejh, nai! To DBI einai ejairetika xrhsimo gia programmatismo se CGI! Sthn pragmatikothta, 8a tolmousa na pw oti o programmatismos se CGI einai mia apo tis kuries xrhseis toy DBI.

To DBI dinei thn ikanothta stoys programmatistes CGI na enisxusoyn tis baseis poy exoyn WWW-fronted, pragma poy parexei stoys xrhstes th dynatothta na paijoyn me terasties posothtes domhmenwn dedomenwn. Epishs, sthn periptwsh poy ena site exei perissoterh kinhsh apo oti o server ths bashs dedomenwn mporei na antimetwpisei, to DBI dinei th dynatothta anaba8mishs toy server ths bashs dedomenwn sto paraskhnio, xwris allages sta cgi scripts.

11.2.11 Pws petyxainw taxuteroys xronoys sundeshs me DBD Oracle kai CGI;

O Apache httpd diathrei mia dejamenh (pool) apo paidia toy (httpd children) gia na ejyphretoun tis aithseis twn clients.

Xrhsimopoiwntas to module toy Apache mod perl toy Doug MacEachern, o metafrasths ths perl (perl interpreter) enswmatwnetai sta paidia toy httpd. Ta CGI, DBI, kai ta ypoloipa agaphmena sas modules mporoun na fortw8oun kata thn ekkinhsh ka8e paidiou (child). Ayta ta modules de 8a janafortw8oun ean den allajoyn sto disko.

Gia perissoteres plhrofories sxetika me ton Apache, deite to Apache Project’s WWW site:

   • Apache Project WWW site <http://www.apache.org>
   • Mod perl module <http://www.perl.com/cgi-bin/cpan_mod?module=mod_perl>

11.2.12 Pws epitygxanw monimes (persistent) syndeseis metaju DBI kai CGI

Xrhsimopoiwntas to module Apache::DBI module toy Edmund Mergl, ta logins sth bash dedomenwn apo8hkeuontai kai antistoixizontai se ena httpd child. An h efarmogh sas basizetai se enan mono xrhsth ths bashs dedomenwn, h sundesh mporei na ginetai me ka8e child. Mexri shmera, oi syndeseis stis baseis dedomenwn den mporoun na moirazontai metaju diaforetikwn paidiwn toy httpd.

Mporeite na katebasete to Apache::DBI apo th CPAN mesw:

   • <http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI>

11.2.13 “Otan trexw ena perl script apo thn grammh entolhs, doyleuei, alla otan to trexw apo ton httpd, apotygxanei!” Giati;

Basika, enas logos gia ton opoio mporei na symbainei ayto einai oti o xrhsths apo ton opoio trejate to script sth grammh entolwn exei swsta ry8mismena tis metablhtes toy periballontos, sthn periptwsh toy DBD::Oracle, metablhtes opws $ORACLE HOME, $ORACLE SID h TWO TASK.

H diergasia httpd trexei synh8ws katw apo to xrhsth nobody, pragma poy shmainei oti den exei ry8mismeno to periballon toy. Opoiodhpote script epixeirhsei na trejei katw apo aythn thn katastash 8a apotuxei sigoyra.

Gia na lusete ayto to problhma, 8este to periballon gia th bash sas se ena mplok BEGIN ( ) sthn arxh toy script sas. Etsi 8a dior8w8ei to problhma.

Paromoia, 8a prepei na elegjete to logfile me ta httpd la8h gia tyxon endeijeis, opws kai ta “Idiot’s Guide To Solving Perl / CGI Problems” kai “Perl CGI Programming FAQ” gia perissoteres plhrofories. Einai api8ano to problhma na exei sxesh me to DBI. Diabaste kai ta duo ayta keimena prosektika!

• To “Idiot’s Guide To Solving Perl / CGI Problems” 8a to breite sto: <http://www.perl.com/perl/

     faq/index.html>

11.2.14 Mporw na kanw multi-threading me to DBI;

Mexri thn hmeromhnia aytou toy FAQ, oxi. H perl den yposthrizei multi-threading. Parolayta, to multithreading anamenetai na ginei meros toy pyrhna ths dianomhs ths perl sthn ekdosh 5.005, poy shmainei oti to DBI 8a mporei na yposthrizei multi-threading arketa suntoma meta ap’ ayto.

Gia na deite paradeigmata kwdika OCI gia thn Oracle poy exei multi-threaded entoles SELECT, phgainete sto:

   • <http://www.hermetica.com/technologia/oracle/oci/orathreads.tar.gz>

11.2.15 Pws mporw na kalesw stored procedures me to DBI;

An ypo8esoyme oti exete dhmioyrghsei mia stored procedure mesa se kapoia bash, px, sthn Oracle, mporeite na xrhsimopoihsete to $dbh->do gia na ektelesete amesa th diadikasia (procedure). Gia paradeigma,

$dbh->do( ”BEGIN someProcedure END” );

11.2.16 Pws mporw na parw tis times poy epistrefontai apo tis stored procedures me to DBI;

8ymh8eite, omws, na kanete elegxo gia la8h!

         $sth = $dbh->prepare( "BEGIN foo(:1, :2, :3); END;" );
         $sth->bind_param(1, $a);
         $sth->bind_param_inout(2, \$path, 2000);
         $sth->bind_param_inout(3, \$success, 2000);
         $sth->execute;

11.2.17 Pws mporw na dhmioyrghsw h na katastrecw mia bash dedomenwn me to DBI;

H dhmioyrgia kai diagrafh mias bashs einai ennoies polu afhrhmenes gia na yposthrizontai ikanopoihtika apo to DBI. Gia paradeigma, h Oracle den yposthrizei kan thn ennoia ths diagrafhs ths bashs! Sthn Oracle epishs, o diakomisths ths bashs dedomenwn (database server) einai oysiastika h bash, enw sthn mSQL, h diergasia toy diakomisth (server process) trexei mia xara xwris na exei dhmioyrgh8ei kamia bash se ayton. To problhma einai toso anomoio gia na to 8ijoyme.

Gi’ ayto to logo, merikoi odhgoi yposthrizoyn dhmioyrgia kai diagrafh basewn mesw twn private func methods. Deite thn tekmhriwsh twn odhgwn poy xrhsimopoieite gia na deite an yposthrizoyn ayto to mhxanismo.

11.2.18 Pws diaxeirizetai to DBI tis times NULL ;

Oi times NULL sto DBI antimetwpizontai opws h timh undef. Oi times NULL mporoun kataxwrh8oun stis baseis ws NULL, gia paradeigma:

         $rv =
             $dbh->do( "INSERT INTO table VALUES( NULL )" );

alla otan erwth8oun, oi times NULL 8a prepei na sygkri8oun me thn undef. Ayto einai stantar gia oloys toys odhgous.

11.2.19 Ti einai aytes oi me8odoi func (func methods);

H me8odos func orizetai sto DBI san to shmeio eisodoy gia leitoyrgikothta ejartwmenh apo th bash, px, h ikanothta na dhmioyrghsete h na diagracete baseis. To na kalesete aytes tis me8odoys poy ejartwntai apo toys odhgous einai aplo, gia paradeigma, gia na kalesete th me8odo createDatabase poy pairnei mia parametro, 8a grafame:

         $rv =
             $dbh->func( 'argument', 'createDatabase' );

Osoi anaptussoyn logismiko 8a prepei shmeiwsoyn oti oi me8odoi func den einai metafersimes metaju diaforetikwn basewn.

11.2.20 Emporikh Yposthrijh kai Ekpaideysh

To Interface ths Perl5 gia baseis einai ena DWREAN logismiko. ERXETAI XWRIS KAMIA EGGYHSH OPOIOYDHPOTE EIDOYS.

Parolayta, merikoi organismoi parexoyn eite texnikh yposthrijh eite programmata ekma8hshs toy DBI.

Perl Clinic : H Perl Clinic mporei na kleisei symbolaia gia emporikh yposthrijh se Perl, DBI, DBD::Oracle kai Oraperl. Yposthrijh parexetai apo thn etaireia sthn opoia doyleuei o Tim Bunce, o syggrafeas toy DBI. Gia perissoteres yphresies sxetika me tis yphresies toys, deite to :

   • <http://www.perl.co.uk/tpc>

12 Ergaleia Diaxeirishs ths PostgreSQL

12.1 PGACCESS - Ena grafiko ergaleio gia th diaxeirish ths PostgreSQL

To PgAccess einai ena Tcl/Tk interface gia thn PostgreSQL. Symperilambanetai hdh sth dianomh ths PostgreSQL. Rijte mia matia se ayto to web site gia neoterh ekdosh

   • <http://www.flex.ro/pgaccess>

• An exete opoiodhpote sxolio, protash gia beltiwsh, mh distasete na steilete e-mail sto : teo@flex.ro

Xarakthristika toy PgAccess

Para8yra toy PgAccess : Kentriko para8yro , dhmioyrgia pinakwn (table builder) , Emfanish pinakwn (erwthsewn) (table(query) view), dhmioyrgia erwthsewn optika (visual query builder).

Pinakes

• - emfanish pinakwn, megisto 200 eggrafes (allazei apo to menou preferences)

• - allagh mege8oys sthlhs, sernontas thn ka8eth grammh (kalutera sto xwro toy pinaka apo oti sthn epikefalida toy pinaka)

• - text wrap sta kelia - apo8hkeysh ths emfanishs ka8e pinaka

• - import/export se ejwterika arxeia (SDF,CSV)

• - dynatothtes filtrarismatos (dwste ena filtro san price>3.14)

• - dynatothtes tajinomhshs (dwste xeirokinhta to(ta) pedia pros tajinomhsh)

• - editing in place

• - beltiwmeno boh8hma gia paragwgh pinakwn (table generator assistant)

• - beltiwmenes dynatothtes dior8wshs pediwn

Erwthseis (Queries)

• - dhmioyrgei, dior8wnei kai apo8hkeuei ”erwthseis poy ka8orizei o xrhsths”

• - apo8hkeuei erwthseis san views

• - ektelei erwthseis

• - emfanish apotelesmatwn erwthsewn tupoy select

• - diagrafh kai allagh onomatos erwthshs

• - Grafiko xtisimo erwthshs me dynatothtes drag & drop. Gia osoys apo esas eixate sthsei to Tcl/Tk

plugin gia to Netscape Navigator, mporeite na to deite na doyleuei patwntas edw Sequences

• - dhmioyrgia sequences, diagrafh kai elegxos toys Synarthseis

• - dhmioyrgia, elegxos kai diagrafh synarthsewn se glwssa SQL Mellontikes ylopoihseis

• - sxediasmos pinakwn (pros8hkh newn pediwn, allagh onomatos, klp.)

• - ka8orismos synarthshs

• - dhmioyrgia report

• - basiko scripting An exete opoiodhpote sxolio, protash gia beltiwsh, mh distasete na steilete e-mail sto :

• teo@flex.ro

Perissoteres plhrofories gia th biblio8hkh libgtcl 8a xreiasteite epishs na dhlwsete pros xrhsh th biblio8hkh diasundeshs PostgreSQL se Tcl san ena Tcl/Tk ’load’-able module. Onomazetai libpgtcl kai o phgaios kwdikas ths brisketai ston katalogo ths PostgreSQL /src/interfaces/libpgtcl. 8a xreiasteite idiaitera, mia biblio8hkh libpgtcl poy na mporei na fortw8ei apo Tcl/Tk. Ayto einai diaforetiko texnika apo ena typiko PostgreSQL loadable object arxeio, epeidh h libpgtcl einai mia syllogh apo object arxeia. Katw apo Linux, onomazetai libpgtcl.so. Mporeite na katebasete apo edw mia ekdosh hdh metaglwttismenh gia systhmata Linux i386. Apla antigracte to libpgtcl.so ston katalogo biblio8hkwn toy systhmatos (/usr/lib)kai jekinhste. Mia lush einai na afairesete apo ton phgaio kwdika th grammh poy periexei to fortwma ths libpgtcl.so kai na fortwsete th pgaccess.tcl oxi me wish, alla me pgwish (h wishpg) ayto to wish me to opoio eixe ginei link me th biblio8hkh libpgtcl.

12.2 Windows Interactive Query Tool gia PostgreSQL (WISQL h MPSQL)

H MPSQL parexei stoys xrhstes ena grafiko SQL interface gia thn PostgresSQL. H MPSQL einai paromoia me to SQL Worksheet ths Oracle kai to ergaleio erwthsewn toy Microsoft SQL Server WISQL. Exei wraio grafiko interface kai istoriko entolwn. Epishs mporeite na kanete cut kai paste kai exei kai alla wraia xarakthristika poy beltiwnoyn thn paragwgikothta.

   • <http://www.troubador.com/~keidav/index.html>
   • Email: keidav@whidbey.com
   • <http://www.ucolick.org/~de/> sto arxeio tcl syb/wisql.html
   • <http://www.troubador.com/~keidav/index.html>
   • Email: de@ucolick.org

12.3 Interactive Query Tool(ISQL) gia thn PostgreSQL - Onomazetai PSQL

To ISQL einai gia termatika me Character command line. Perilambanetai sth dianomh, kai legetai PSQL. Moiazei polu me to ISQL ths Sybase, kai to SQLplus ths Oracle. Sto unix prompt dwste thn entolh ’psql’ h opoia 8a sas bgalei se psql> prompt.

     Pathste \h gia na deite th boh8eia twn entolwn.

Polu filiko sto xrhsth kai eukolo sth xrhsh. Mporeite na exete prosbash se ayto kai apo scripts toy kelyfoys.

12.4 MPMGR - Ergaleio Diaxeirishs Basewn gia PostgresSQL

To MPMGR parexei ena grafiko interface diaxeirishs ths PostgresSQL. 8a to breite sto

   • <www.mutinybaysoftware.com/>
   • Email: keidav@mutinybaysoftware.com
   • <http://www.troubador.com/~keidav/index.html>
   • Email: keidav@whidbey.com
   • <http://www.ucolick.org/~de> in file tcl syb/wisql.html
   • WISQL gia thn PostgreSQL <http://www.ucolick.org/~de/Tcl/pictures>
   • Email: de@ucolick.org

13 Ry8mizontas pollapla koytia PostgreSQL se mia o8onh

Mporeite na stoibajete ta koytia-cpu kai na synde8eite se mia o8onh kai na xrhsimopoihsete to diakopth gia na dialejete to host. Ayto ejoikonomei xwro kai de xreiazeste polles o8ones, plhktrologia kai pontikia (ejoikonomeite peripoy 100 me 500 US dolaria ana set) kai glitwnete epishs apo thn akatastasia. Xrhsimopoiwntas ayth thn texnikh, mporeite na stoibajete pollous PostgreSQL servers (gia anaptyjh, elegxo, paragwgh), Web servers, ftp servers, Intranet servers, Mail servers, News servers se ena polu chlo rafi. O diakopths mporei na xrhsimopoih8ei epishs gia koytia me Windows 95/NT h OS/2. Rijte mia matia sta parakatw sites:

• Thlefwnikes paraggelies apo thn DataComm Warehouse Inc, se 24wrh bash, olh thn ebdomada, sto 1-800-328-2261. Parexoyn ka8e tupo ylikou H/Y <http://www.warehouse.com>. To 4-8yro KVM switch (PS/2) kostizei gurw sta $89.99. Part No. DDS1354

   • Network Technologies Inc <http://www.networktechinc.com/servswt.html> (120 dolaria/PC 8

ports) to opoio exei listes gia ’Server Switches’ kai ’switches mono gia Video ’

   • Scene Double Inc, Agglia <http://www.scene.demon.co.uk/qswitch.htm>
   • Cybex corporation <http://www.cybex.com>
   • Raritan Inc <http://www.raritan.com>
   • RealStar Solutions Inc <http://www.real-star.com/kvm.htm>
   • Belkin Inc <http://www.belkin.com>
   • Better Box Communications Ltd. <http://www.betterbox.com/info.html>

• Phgainete sto plhsiestero magazi hardware kai zhthste to ”Server Switch” gnwsto kai san ”KVM Auto Switches”.

Yajte sth mhxanh anazhthshs yahoo gia na breite perissoteres etaireies me ”Server Switches” h ”KVM Switches”.

Synistatai idiaitera na exete ena unix box eidika afierwmeno gia ka8e PostgreSQL data-server gia kaluterh apodosh. Kamia allh efarmogh/diergasia den prepei na trexei se ayto to mhxanhma. Deite to tmhma ”Epaggelmatika” stis topikes efhmerides gia topikous pwlhtes poy pwloun mono koytia intel, 13” monoxrwmes o8ones (o8onh polu xamhlou kostoys). Oi topikoi pwlhtes pwloun mono to hardware xwris Microsoft Windows/DOS (etsi ejoikonomeite $ 150). De xreiazeste egxrwmh o8onh gia to diakomisth ths bashs dedomenwn, ka8ws mporeite na kanete apomakrysmenh diaxeirish (remote administration) apo egxrwmo sta8mo ergasias. Parte to RedHat (h kapoia allh dianomh) Linux cdrom apo to -

• Linux System Labs Web site: <http://www.lsl.com/> 7 (U.S. dolaria)

• Cheap Bytes Inc Web site: <http://www.cheapbytes.com/> 7 (U.S. dolaria)

Sigoyreyteite oti to yliko poy agorasate yposthrizetai apo to Redhat Linux. Deite to ftp site hs Redhat prin agorasete yliko, gia proteinomenoys SCSI adapters, kartes binteo klp. Me $ 600 mono mporeite na parete ena isxyro koyti intel me Redhat Linux poy trexei PostgreSQL. Xrhsimopoihste odbc/jdbc/perl/tcl gia na synde8eite me thn PostgreSQL apo Windows95, OS/2, Unix Motif h kapoio web browser (p.x. Redbaron, Opera, Netscape, 20 alloi). (oi Web browsers exoyn ginei pia standard client).

Me ayth thn idea mporeite na elegxete polla koytia cpu me mia o8onh kai ena plhktrologio!

Parakatw 8a breite ena apospasma apo thn networktechnic Inc gia ”Server Switches”

Paraggeilete twra sto 800-742-8324 (xwris dasmous gia Amerikh)

Gia na labete ton katalogo mas parakalw steilte Email sth dieu8ynsh: sales@networktechinc.com

XEIRISTEITE PERISSOTERA APO ENA PC me ena plhktrologio, o8onh kai pontiki Oi hlektronikoi diakoptes epitrepoyn me ena plhktrologio, o8onh kai pontiki na xeiris8eite 64 PC. Enswmatwmenoi mikroupologistes prosomoiwnoyn thn paroysia plhktrologioy, o8onhs kai pontikiou me ola ta prosarthmena PC 100% toy xronoy.

Xarakthristika kai Efarmoges

• Plhktrologio, xeiristhrio panw sth syskeyh h thlexeiristhrio • 9 pin D Serial h 6 pin miniDIN yposthrijh gia pontiki

• 5 pin DIN h 6 pin miniDIN yposthrijh plhktrologioy

• 1600x1200 analysh o8onhs

• Xrhsimopoiei koina kalwdia

• Se Desktop kocimo h kai gia rack Prodiagrafes - Plhktrologio

• Ola ta busmata einai 8hlyka

• 5 pin DIN h 6 pin miniDIN

• Mporei na ekkinei opoiadhpote stigmh opoiondhpote H/Y Xeiristhrio - Mprostina Koympia

• Synde8eite se enan H/Y me to pathma enos koympiou

• Krathste pathmeno opoiodhpote koympi gia perissotero apo miso deyterolepto kai mpeite se tropo leitoyrgias SCAN, BROADCAST h COMMAND

• Ta LEDs ypodeiknuoyn ton tropo leitoyrgias toy plhktrologioy

• Pathste CTRL+* kai mpeite se tropo leitoyrgias COMMAND

• Einai dia8esimoi oi SCAN, BROADCAST kai COMMAND tropoi leitoyrgias Pontiki

* 9 pin D serial • o diakopths NTI poy prosomoiwnei to seiriako pontiki ths Microsoft

• o 9 pin D arseniko gia pontiki

• o 9 pin D 8hlyko gia toys H/Y

* 6 pin miniDIN • o diakopths NTI poy prosomoiwnei to pontiki IBM PS/2

• o Ola ta busmata einai 8hlyka Kalwdiako xeiristhrio/thlekontrol

• Proairetiko –8a prepei na agorastei jexwrista

• Kanei tis doyleies toy ”Xeiristhrioy - Mprostinwn Koympiwn” O8onh-VGA

• Euros 150 MHz

• 1600X1200 analysh xwris paramorfwsh

• 1/4la ta busmata einai 8hlyka

14 Efarmoges kai Ergaleia gia thn PostgreSQL

14.1 Glwssa 4hs genias (4GL) PostgreSQL gia efarmoges me web kai bash dedomenwn - Platforma anaptyjhs AppGEN

To AppGEN mporeite na to katebasete apo to

   • <http://www.man.ac.uk/~whaley/ag/appgen.html>
   • <ftp://ftp.mcc.ac.uk/pub/linux/ALPHA/AppGEN>.

To AppGEN einai mia ychlou epipedoy, tetarths genias glwssa kai platforma anaptyjhs efarmogwn gia thn paragwgh efarmogwn basismenwn sto World Wide Web (WWW). Aytes oi efarmoges typika xrhsimopoiountai sto internet h sto intranet enos organismou. Oi efarmoges toy AppGEN ylopoiountai ws C scripts poy akoloy8oun ta protypa toy Common Gateway Interface (CGI), ta opoia yposthrizontai apo toys perissoteroys Web Servers.

Gia na xrhsimopoihsete to AppGEN 8a xreiasteite ta akoloy8a :-

Thn PostgresSQL, susthma diaxeirishs sxesiakwn basewn dedomenwn

Enan web server poy na yposthrizei CGI opws o HTTPD toy NSCA

Enan metaglwttisth ansi C opws o GCC

To AppGEN apoteleitai apo ta akoloy8a ektelesima gia Unix (Linux) :-

• defgen, to opoio paragei mia basikh protyph efarmogh (template application) apo kapoies logikes domes dedomenwn. Oi efarmoges mporoun na eisagoyn, enhmerwnoyn, diagrafoyn kai caxnoyn eggrafes sthn bash dedomenwn enw parallhla diathroun aytomata kai thn akeraiothta twn dedomenwn (referential integrity).

• appgen, o metaglwttisths AppGEN poy metaglwttizei kwdika appgen se ektelesimo CGI C kwdika kai keimena HTML etoima gia xrhsh se enan web server.

• dbf2sql, mia efarmogh gia metatroph arxeiwn symbatwn me dBase III .dbf se ektelesima SQL scripts. Ayto epitrepei se dedomena poy fylassontai sta perissotera paketa basewn dedomenwn gia DOS/Windows na metafer8oun se enan SQL server opws h PostgresSQL.

• Epipleon, to AppGEN parexei mia syllogh apo keimena HTML , arxeia GIF kai Java applets poy xrhsimopoiountai apo to susthma, kai fysika, opws ka8e kalo logismiko, symperilambanei kai ton plhrh phgaio kwdika.

Mporeite na epikoinwnhsete me ton syggrafea, Andrew Whaley, sto

   • andrew@arthur.smuht.nwest.nhs.uk

14.2 WWW Web interface gia PostgresSQL - DBENGINE

To dbengine einai ena plug ’n play Web interface gia thn PostgreSQL poy dhmioyrgh8hke apo ton Ingo Ciechowski. Brisketai sto :

   • <http://www.cis-computer.com/dbengine/>

Sxetika me to DBENGINE : To dbengine einai ena interface diasundeshs WWW kai Postgres95 poy parexei aplh prosbash se opoiadhpote bash mesa se liga lepta.

To PHP 3 dinei mia glwssa poy moiazei me thn Perl sta keimena sas, alla oxi pragmatikh Perl enw to AppGen kai to wdb-p95 apaitoun na dhmioyrghsete merika arxeia ry8misewn gia ka8e mia apo tis baseis sas – moiazei san na prepei prwta ap’ ola na ma8ete kapoio eidos neas glwssas prin na jekinhsete.

Anti8eta me ta alla ergaleia, den apaiteitai na ma8ete eidiko programmatismo h kapoia scripting language gia na jekinhsete na doyleuete me to dbengine. Den yparxei epishs kapoio arxeio ry8misewn gia ka8e bash, etsi de xreiazetai na ejoikeiw8eite me mia nea domh. Parolayta - se periptwsh poy 8elete na exete prosbash se ola ta xarakthristika toy dbengine 8a htan kalh idea na ma8ete th glwssa Perl.

Olo to susthma mporei na ry8mistei mesw aplwn xeirismwn se mia pros8eth bash dedomenwn poy periexei plhrofories sxetika me to pws na optikopoihsete ta dedomena sas. Mporeite epishs na orisete virtual Fields ta opoia ypologizontai amesws prin na emfanistoun sthn o8onh.

Adeia To dbengine einai dwrean logismiko katw apo toys idioys oroys opws kai h Perl. Diabaste thn adeia ths an den eiste sigoyroi gia ti mporeite h den mporeite na kanete. Se telikh analysh, ayth einai mia elastikoterh kai pio hpia ekdosh apo thn GNU adeia – den ephreazei th doyleia sas an 8elete na ”daneisteite” kati apo to dbengine h na sygkentrwsete kommatia apo ayto san meros enos emporikou proiontos!

14.3 Apache Webserver Module gia PostgreSQL - NeoSoft NeoWebScript

O Apache einai enas polu gnwstos Web Server. Ena module diasundeshs PostgreSQL me ton Apache Webserver brisketai sto -

   • <http://www.neosoft.com/neowebscript/>

To NeoWebScript einai mia glwssa programmatismou poy epitrepei kai apla kai sun8eta programmata na enswmatw8oun se arxeia HTML.

Otan zhteitai mia selida HTML poy periexei enswmatwmeno kwdika NeoWebScript, o webserver poy yposthrizei NeoWebScript ektelei to(a) enswmatwmena script(s), kai paragei mia web selida me periexomeno kommeno kai rammeno stis protimhseis toy programmatisth, h opoia dhmioyrgh8hke me ayto to programma.

To NeoWebScript einai enas grhgoros, asfalhs, eukolos tropos gia na ma8ete isxyro, server-based programmatismo ston kwdika HTML twn web selidwn. Me to NeoWebScript, einai eukolo na ftiajete metrhtes (counters), formes gia email, gkrafiti stis selides, guest books kai na kratate stoixeia gia toys episkeptes, akomh kai gia enan arxario programmatisth. Deite poso kala to NeoWebScript krata ta dika toy se sugkrish me thn PERL kai to JavaScript.

An 8elete na egkatasthsete to NeoWebScript ston webserver sas, o Webmaster sas prepei na diabasei to Sysop FAQ gia na jekinhsei. H ”8ewria twn Leitoyrgiwn” (Theory of Operations) 8a ejhghsei pws doyleuei to NeoWebScript, enw h egkatastash 8a sas ka8odhghsei sta diafora stadia ths. H diaxeirish asxoleitai me 8emata ru8mishs kai ekteleshs toy server, diaforoi elegxoi epalh8euoyn th swsth leitoyrgia twn NeoWebScript sas kai h aposfalmatwsh asxoleitai me ta problhmata toy server.

Den yparxei kanena kostos gia th xrhsh toy NeoWebScript-2.2 gia ton ISP sas, to intranet sas h to extranet sas. 8a deite thn plhrh adeia xrhshs, otan eggrafeite gia na to katebasete, alla h oysia einai pws 8a 8elame 99 spartarista dolaria an 8elete na to enswmatwsete sta dika sas proionta h na to xrhsimopoihsete se enan server emporikwn syndiallagwn (p.x. SSL).

To NeoWebScript einai ena module gia ton Apache webserver poy sas epitrepei thn enswmatwsh ths glwssas programmatismou Tcl/Tk stis istoselides sas san ena ergaleio scripting. Epinoh8hke apo ton Karl Lehenbauer, ton Texniko Diey8ynth ths NeoSoft, kai tekmhriw8hke, employtisthke kai epekta8hke apo toys programmatistes kai texnikous syggrafeis ths NeoSoft.

O Apache webserver einai o pleon dhmofilhs webserver ston kosmo, xrhsimopoioumenos sto 68 % twn sites poy ejetasthkan.

H Tcl/Tk einai h panisxyrh, dwrean, anejarthth platformas glwssa scripting, poy anaptux8hke apo ton Dr. John Ousterhout. Para8etoyme ta logia toy

”H Tcl/Tk epitrepei stoys programmatistes logismikou na kanoyn thn doyleia deka fores taxutera apo oti xrhsimopoiwntas ergaleio8hkes (toolkits) basismenes se C h C++. Einai epishs mia teleia glwssa enswmatwshs hdh yparxontwn efarmogwn poy tis kanei pio grafikes kai tis ejoplizei me Internet-ikes dynatothtes”.

O Karl Lehenbauer, Idryths kai Proistamenos toy Texnikou Tmhmatos ths NeoSoft, apotelei meros ths anaptyjhs ths Tcl/Tk apo ta prwta ths stadia. Mazi me ton Mark Diehkans, dhmiourghsan thn Extended Tcl, gnwsth epishs kai ws TclX h NeoSoft Tcl, ena isxyro sunolo epektasewn sth glwssa. Polles apo tis basikes entoles ths Tcl proekycan apo thn Extended Tcl, kai meta eishx8hsan apo ton Dr. Ousterhout sto basiko pyrhna ths glwssas.

NeoSoft Inc., 1770 St. James Place, Suite 500, Houston, TX 77056 USA

14.4 Oi HEITML epektaseis ths HTML ston server kai mia glwssa 4hs genias gia thn PostgreSQL

To ergaleio heitml einai enas allos tropos gia na epikoinwnei h postgres me to world wide web. Gia perissoteres plhrofories epikoinwnhste me ton

               Helmut Emmelmann H.E.I. Informationssyteme GmbH
               Wimpfenerstrasse 23 Thl. 49-621-795141
               68259 Mannheim Germany Faj. 49-621-795161

• Steilte email ston K. Helmut Emmelmann sto emmel@h-e-i.de

   • H kuria selida toy Heitml <http://www.heitml.com>

• H deytereuoysa selida toy Heitml <http://www.h-e-i.deom>

To heitml einai epektaseis ths HTML sthn pleyra toy server kai taytoxrona glwssa 4hs genias. Mporeite na gracete efarmoges gia to web se styl HTML xrhsimopoiwntas HTML-oeidh tags.

To heitml (proferete ”Xai”-TiEmEl) einai epektash toy HTML kai mia plhrws ejoplismenh glwssa 4hs genias poy epitrepei se efarmoges Web na allhlepidroun me dedomena poy fylassontai se SQL baseis, xwris na katafeugoyn se periploka CGI scripts.

To heitml epekteinei to HTML sthn pleyra toy server, metatrepontas dynamika arxeia ”.hei” se HTML kai einai loipon symbato me ka8e web browser. Xrhsimopoiei thn gnwrimh, euxrhsth suntajh HTML kai parexei plouto prokataskeyasmenwn Tags kai Biblio8hkwn gia na lusoyn 8emata poy mexri twra xreiazontan CGI. Opws kai to XML, to heitml parexei tags orismena apo ton xrhsth. Me to heitml ta orismena apo ton xrhsth tags metatrepontai se HTML kai stelnontai ston browser.

To heitml stoxeuei kai stoys sxediastes HTML kai stoys epaggelmaties programmatistes. Oi sxediastes HTML mporoun na xrhsimopoioun heitml Tags gia na xtistoun dynamikes selides web, na prospelaunoyn SQL baseis, h na dhmioyrgoun sun8etes efarmoges web. Metrhtes, baseis me stoixeia kataxwrhshs, formes anazhthshs, formes email , ierarxika menou, ola mporoun na kataskeyastoun apla xrhsimopoiwntas proka8orismena HTML-oeidh Tags poy briskontai stis diafores Biblio8hkes.

Gia toys programmatistes, to heitml enswmatwnei mia plhrh glwssa 4hs genias se HTML

               (p.x. <if>, <while>, kai <let> Tags),

syn isxyres dynatothtes ypologismou ekfrasewn me akeraioys, pragmatikous, dyadikous, alfari8mhtikous, tuples telestes. Ta Tuples antimetwpizontai opws stis monternes antikeimenostrafeis glwsses kai fylassontai se metablhtes swrwn (heap variable). Oi metablhtes ths heitml, symperilambanomenwn kai olwn twn sun8etwn domwn dedomenwn, fylassontai sto swro diathrwntas tis arxikes toys times metaju twn selidwn xrhsimopoiwntas to Session Mode. Einai dynaton na orisete ta dika sas tags h tags toy periballontos kai akoma kai na epanorisete ta HTML-tags.

To heitml kanei dynato to na

- - - anaptyx8oun Web Sites me ena domhmeno kai spondylwto tropo, wste na meiw8ei drastika h ka8ysterhsh logw synthrhshs.

- - - anaptyx8oun ejypna kai allhlepidrastika Web Sites, me periexomeno poy prosarmozetai dynamika stis anagkes toy xrhsth.

- - - emfanisete to periexomeno SQL basewn xwris na xreiastei ka8oloy programmatismos ektos apo to na xrhsimopoihsete th biblio8hkh mas twn proka8orismenwn ”dba” Tags.

- - - anaptyx8oun efarmoges sun8etwn basewn dedomenwn kai katalogwn agorwn xrhsimopoiwntas tis Session Variables

To heitml trexei se Linux me opoiondhpote Web Server poy xrhsimopoiei CGI interface, kai einai idiaitera grhgoro (apofeugontas thn ka8ysterhsh logw CGI) me ton APACHE Web Server xrhsimopoiwntas to Apache API. Mexri twra yposthrizontai oi baseis MSQL (ekdosh 1 kai 2), PostgreSQL (ekdosh 6), mysql, kai h yard. To heitml doyleuei epishs se Linux, BSDi, Solaris kai SunOS, ka8ws kai se Windows NT me CGI kai ISAPI kai ODBC kai Windows 95.

To heitml (se linux) einai dwrean gia ereynhtikh, mh-emporikh kai idiwtikh xrhsh. Ta emporika Web Sites prepei na plhrwsoyn telh gia thn adeia xrhshs. H plhrhs leitoyrgikh ekdosh toy heitml einai dia8esimh na thn katebasete gia mia periodo dokimhs dwrean. (Shmeiwste, parolayta, oti ka8e Web selida ”.hei” poy anaptussete 8a emfanizei ena mhnyma poy 8a to xarakthrizei san ekdosh gia mh emporikh xrhsh. Meta thn eggrafh, 8a labete ena kleidi gia na ejafanisete ayto to mhnyma xwris na xreiastei na epanegkatasthsete to programma.)

To heitml (proferetai ”Xai”-TiEmEl) epekteinei kai employtizei shmantika th leitoyrgikothta ths HTML me ton orismo tags kai xarakthristika plhres programmatismou. Ayto kanei dynath thn uparjh efarmogwn dynamikou periexomenoy kai basewn dedomenwn mesa ston kosmo ths HTML, xwris CGI kai ejwteriko scripting h alles glwsses programmatismou. Ayto shmainei oti eseis, san syggrafeas HTML, mporeite na pros8esete efarmoges stis web selides sas, xrhsimopoiwntas apla merika nea tags xwris CGI kai ka8oloy programmatismo. Apo thn allh, san proxwrhmenos xrhsths h programmatisths mporeite na dhmioyrghsete isxyres programmatistikes biblio8hkes me tag. Ayth h proseggish kanei to heitml katallhlo toso gia toys neofertoys sthn HTML oso kai gia toys epaggelmaties programmatistes. To heitml trexei sto web server kai dhmioyrgei dynamika HTML, etsi wste to heitml na einai symbato me ta stantar toy internet kai me opoiodhpote web browser. Epitrepei plhrh prosbash se baseis enw prostateuei to xrhsth apo thn peritth polyplokothta toy CGI. To heitml exei anaptyx8ei sumfwna me prosfates ereynes kai se systhmata kataskeyhs metaglwttistwn kai dosolhciwn (transaction).

Oi selides heitml anaptussontai opws kai oi selides HTML, me enan text editor h enan HTML editor, kai topo8etountai sto web server me to gnwsto tropo. Parolayta, oi selides mporoun na periexoyn twra dynamika heitml tags kai biblio8hkes tag gia prosbash se baseis. Mporeite na xrhsimopoihsete ayta ta tags gia na exete prosbash se baseis, na dhmioyrghsete dynamiko periexomeno, na steilete emails, kai na dhmioyrghsete akomh isxyres efarmoges opws eggrafh se baseis kai systhmata agorwn.

15. Ergaleio gia Sxediasmo/Ylopoihsh Web Basewn Dedomenwn gia thn PostgreSQL - EARP36

Oi neofertoi sthn glwssa HTML kai oi epaggelmaties programmatistes 8a meinoyn ekplhktoi me to poso grhgora kai eukola mporoun na sxediasoyn endiaferoyses efarmoges opws to Interactive Guestbook xwris na xreiazetai na ma8oyn na grafoyn sun8eta kai poluploka CGI scripts, apla kai mono xrhsimopoiwntas ta ergaleia poy parexontai me th dba biblio8hkh mas.

To heitml synodeuetai apo ena megalo plh8os tag biblio8hkwn, gia na dhmioyrghsete guestbooks, efarmoges synthrhshs ths bashs, epektasimes formes erwthsewn, isxyres formes email h na domhste to web site sas xrhsimopoiwntas ena ierarxiko menou. Ayta ta ergaleia einai etoima, apla pros8este ta antistoixa tags sto web site sas.

San empeiros programmatisths, mporeite na kanete plhrh xrhsh ths heitml arxitektonikhs dynamikwn eggrafwn: To heitml den einai apla mia scripting glwssa me dynamikous tupoys, isxyrh ston ypologismo ekfrasewn, anadromikes roytines kai perasma ektetamenwn parametrwn, alla xarakthrizetai epishs apo dynamikes eggrafes gia thn aytomath diaxeirish twn dedomenwn enos session anejarthtoy mege8oys.

14.5 America On-line AOL Web server gia PostgreSQL

O dwrean emporikos webserver, AOLserver ekdoshs 2.3 yposthrizei syndeseis sth bash PostgreSQL ekdosh 6.2.1 kai megaluterh. Gia perissoteres plhrofories episkefteite to

   • AOL Web Server <http://www.aolserver.com>

14.6 Problem/Project Tracking System Application Tool gia PostgreSQL

Brisketai sto :

   • <http://www.homeport.org/~shevett/pts/>

14.7 Metatroph arxeiwn dbase dbf se PostgreSQL

To programma dbf2msql doyleuei acoga me mSQL kai PostgreSQL. Mporeite na to breite sto

   • <ftp://ftp.nerosworld.com/pub/SQL/dbf2sql/>
   • <ftp://ftp.postgresql.org/pub/incoming/dbf2pg-3.0.tar.gz>

To programma ayto grafthke apo ton Maarten Boekhold, Faculty of Electrical Engineering TU Delft, NL Computer Architecture and Digital Technique section

   • M.Boekhold@et.tudelft.nl

Mporeite na xrhsimopoihsete epishs python gia na diabasete arxeia dbf kai na ta fortwsete se mia bash dedomenwn postgres.

   • Deite to <http://www.python.org>

15 Ergaleio gia Sxediasmo/Ylopoihsh Web Basewn Dedomenwn gia thn PostgreSQL - EARP

   • <http://www.oswego.edu/Earp>

• <ftp://ftp.oswego.edu> ston katalogo ’pub/unix/earp’.

15.1 Ti einai to EARP ;

To EARP einai ena ergaleio gia sxediasmo/ylopoihsh Web basewn, poy ka8etai panw apo to susthma bashs dedomenwn PostgreSQL. Sth leitoyrgikothta toy perilambanontai:

• Ena susthma grafikou sxediasmou.

• Ena interface gia sendmail. (mporei na xeiristei ta eiserxomena kai ejerxomena mail)

• Ena ayjhmeno mhxanismo asfaleias.

• Enan odhgo cgi.

15.2 Ylopoihsh

H kuria ylopoihsh toy EARP einai ena ektelesimo CGI poy trexei katw apo to daimona http kai parexei prosbash sto diakomisth ths bashs dedomenwn. Ola ta ergaleia sxediasmou einai xtismena mesa ston odhgo, o sxediasmos den ginetai para mono se web. Ta idia ta ergaleia apaitoun ena grafiko browser, h symbatothta twn antikeimenwn poy sxediazontai me ta ergaleia einai anejarthta toy tropoy ylopoihshs, basismena sto sxediasmo atomikwn protimhsewn.

15.3 Ti xreiazeste gia na trejete to EARP

To EARP prepei na trexei pi8ana se polles platformes me ligo h ka8oloy metafora. Oi gnwstes platformes poy trexei einai oi ejhs:

• Solaris 2.5

• Linux 1.2.13+

• GNU C++

• PostgreSQL (ekdosh 1.01 / 1.02 )

• netsite server

• NCSA httpd

• GNU C++

• PostgreSQL (ekdosh 1.01 / 1.02 )

• NCSA httpd

• Apache httpd

H trexoysa ekdosh (1.3) toy Earp sxediasthke panw sthn ekdosh toy libpq poy erxetai me thn PostgreSQL v1.01/1.02. An xrhsimopoieite mia pio prosfath ekdosh ths Postgres, na perimenete pws to programma 8a xreiastei merikes allages gia na doylecei swsta. Sthn anaptyssomenh ekdosh (Earp 2.0), h yposthrijh libpq enswmatwnetai san module.

16. PHP Hypertext Preprocessor, mia scripting glwssa gia thn PostgreSQL h opoia enswmatwnetai se html kai ekteleitai sto Server 38

15.4 Pws doyleuei ;

Ena apo ta kyriotera xarakthristika toy EARP einai oti xrhsimopoiei Antikeimenostrafh me8odo gia na paragei html selides poy epikoinwnoun me th bash. Oi perissoteres selides apotelountai apo diafora antikeimena (objects). Ka8e antikeimeno paragetai apo kapoioy tupoy ergaleio kai afou toy do8ei ena onoma, ta antikeimena syndeontai metaju toys se mia allhloyxia poy mporei na kalestei apo to ergaleio ths selidas (page tool). Ta antikeimena einai mporoun na xrhsimopoih8oun apo pollaples selides. Yparxoyn basika ergaleia gia HTML, Erwthseis (Querys), na pairnete times apo tis formes, na formarete erwthseis kai antikeimena eisodoy, kai na syndeete metaju toys ta antikeimena se alla antikeimena. Perissotera ejeligmena ergaleia perilambanoyn to ergaleio gia mail kai to multithreaded ergaleio erwthsewn.

Allo xarakthristiko toy EARP einai h ejtra asfaleia. H prosbash se diafores perioxes toy systhmatos EARP mporei na perioristei me diaforoys tropoys. Gia na eykolunei thn ejtra asfaleia, to EARP elegxei gia ka8e sundesh sto susthma, kai prosdiorizei se poia ids kai gkroyp anhkei o syndedemenos agent. H prosbash se perioxes ka8orizetai jexwrista, kai o syndyasmos apofasizei an epitrepetai h prosbash se mia sygkekrimenh perioxh toy Earp. Epipleon, o,ti apaiteitai gia na ylopoihsete ta xarakthristika asfaleias einai enas http server poy yposthrizei basiko (h kalutera) user authentication.

15.5 Pou 8a to brw ;

Mporeite na katebasete to EARP me anonymous ftp apo to

• <ftp://ftp.oswego.edu> ston katalogo ’pub/unix/earp’.

16 PHP Hypertext Preprocessor, mia scripting glwssa gia thn PostgreSQL h opoia enswmatwnetai se html kai ekteleitai sto Server

Ergaleio diasundeshs me to WWW

   • <http://www.php.net>
   • <http://www.vex.net/php>

To palio onoma einai Professional Home Pages (PHP 3) kai to neo onoma einai PHP Hypertext Pre-Processor

• Yparxoyn Mirror sites se polles xwres opws to www.COUNTRYCODE.php.net

   • <http://www.fe.de.php.net>
   • <http://www.sk.php.net>
   • <http://php.iquest.net/>

Gia erwthseis, steilte e-mail sto :

   • rasmus@lerdorf.on.ca

To PHP 3 einai mia scripting glwssa gia thn PostgreSQL h opoia enswmatwnetai se html kai ekteleitai sto Server. Sas epitrepei na grafete apla scripts sta arxeia .HTML paromoia me thn JavaScript, mono poy anti8eta me thn JavaScript, to PHP 3 den ejartatai apo to browser. To JavaScript einai mia glwssa h opoia enswmatwnetai se html kai trexei sto client-meros enw to PHP 3 ekteleitai sto Server. To PHP 3 einai paromoio sthn sullhch me to proion ths Netscape LiveWire Pro. An exete ta apaitoumena xrhmata, kai trexete ton emporiko Server ths Netscape kai exete ena apo ta yposthrizomena leitoyrgika systhmata, isws 8a prepei na rijete mia matia sto LiveWire Pro. An sas aresei to dwrean, taxutata anaptyssomeno logismiko poy erxetai me olo ton phgaio kwdika pi8ana na sas aresei to PHP 3.

16.1 Kuria xarakthristika

Yposthrijh stantar CGI, FastCGI kai Apache module. San ena stantar programma CGI, to PHP 3 mporei na egkatasta8ei se opoiadhpote mhxanh Unix kai na trejei se opoiodhpote Unix web server. Me thn yposthrijh toy neoy stantar FastCGI, to PHP 3 exei to pleonekthma twn beltiwsewn sthn taxuthta poy ofeilontai se ayto to mhxanismo. San Apache module, to PHP 3 ginetai ejairetika isxyro kai tromaktika grhgorh enallaktikh toy programmatismou se CGI.

• Katagrafh twn prosbasewn (Access Logging) Me th dynatothta katagrafhs twn prosbasewn toy PHP 3, oi xrhstes mporoun na synthrhsoyn to diko toys metrhth kai katagrafea prosbasewn (hit counting and logging). De xrhsimopoiei me kanena tropo ta kentrika arxeia prosbashs sto susthma, kai parexei parakolou8hsh prosbasewn se pragmatiko xrono. To Log Viewer Script parexei mia suntomh perilhch twn prosbasewn se ena sunolo selidwn gia ka8e jexwristo xrhsth. Epipleon, to paketo mporei na ry8mistei wste na paragei ena footer se ka8e selida to opoio deixnei plhrofories sxetika me thn prosbash. Deite to telos ayths ths selidas gia ena paradeigma se ayta.

• Elegxos prosbasewn Mia enswmatwmenh o8onh, basismenh sto web, xeirizetai tis ry8miseis gia ton elegxo twn prosbasewn. Einai dynato na dhmioyrghsete kanones gia oles h kapoies apo tis web selides poy exei kapoio sygkekrimeno atomo, to opoio 8etei diaforoys periorismous gia to poios mporei na blepei aytes tis selides kai pws 8a tis blepei. Oi selides mporei na prostateuontai me kwdiko, na einai plhrws apagoreymenes, na einai apenergopoihmenh h katagrafh (logging disabled) kai akomh perissotera basismena sto domain toy client, browser,th dieu8ynsh e-mail h akomh kai to sxetiko keimeno.

• Yposthrijh gia Postgres H Postgres einai ena ejeligmeno dwrean RDBMS. To PHP 3 yposthrizei thn enswmatwsh Postgres95 kai PostgresSQL SQL erwthsewn katey8eian mesa se arxeia .html.

• Yposthrijh RFC-1867 Apostolh/Anebasma Arxeiwn (File Upload) To Upload arxeiwn einai ena neo xarakthristiko sto Netscape 2.0. Epitrepei stoys xrhstes na steiloyn (upload) ta arxeia toys sto web server. To PHP 3 parexei to pragmatiko Mime decoding gia na to kanei ayto na doylecei kai epishs parexei to plaisio gia na kanete kati xrhsimo me to arxeio poy steilate, molos to labei o server.

• HTTP-based authentication control To PHP 3 mporei na xrhsimopoih8ei gia na dhmioyrghsei mhxanismous authentication epi paraggelia, basismenoys se HTTP, gia ton Apache web server.

• Metablhtes, Pinakes (arrays), Sysxetistikoi pinakes (Associative Arrays) To PHP 3 yposthrizei metablhtes tupwn (typed variables), pinakes kai akomh kai Perl-oeideis sysxetistikous pinakes (associative arrays). Ola ayta mporoun na pernoun apo th mia web selida sthn allh xrhsimopoiwntas tis me8odoys twn formwn, GET h POST.

• Conditionals, While Loops To PHP 3 yposthrizei mia glwssa scripting me ola ta xarakthristika ths C. Mporeite na exete syn8hkes if/then/elseif/else/endif opws kai while loops kai dhlwseis switch/case gia na perigracei th logikh roh toy pws 8a emfanizetai h html selida.

• Extended Regular Expressions Ta Regular expressions xrhsimopoiountai polu gia taytopoihsh (pattern matching), antikatasthseis twn pattern kai geniko xeirismo alfari8mhtikwn. To PHP 3 yposthrizei oloys toys koinous telestes kanonikwn ekfrasewn.

• Raw HTTP Header Control H dynatothta na kanoyme tis web selides na stelnoyn eidika tropopoihmenes epikefalides HTTP analoga me kapoies syn8hkes einai aparaithto gia sxediasmo web sites ychlou epipedoy. Syxnh xrhsh aytou, einai h apostolh mias topo8esias: URL header gia anakateu8ynsh toy pelath poy ekane thn klhsh pros allo URL. Mporei na xrhsimopoih8ei epishs gia na apenergopoihsoyme to caching h na epejergastoume thn teleytaia epikefalida enhmerwshs.

• Dhmioyrgia GIF eikonas epi topoy/ston aera (On-the-fly) To PHP 3 yposthrizei th GD biblio8hkh eikonwn toy Thomas Boutell h opoia sas dinei th dynatothta na dhmioyrghsete GIF eikones epi topoy.

• Yposthrijh ISP ”Safe Mode” To PHP 3 yposthrizei to monadiko ”Safe Mode” to opoio kanei asfales to na exete pollous xrhstes na trexoyn PHP scripts ston idio server.

• Einai dwrean! Kai to teliko oysiastiko xarakthristiko. To paketo einai entelws dwrean. Brisketai katw apo thn adeia GPL h opoia sas epitrepei na xrhsimopoihsete to logismiko gia opoiodhpote skopo, emporiko h opoiondhpote allo. Deite to keimeno ths dhmosias adeias GNU gia perissoteres leptomereies.

16.2 Anagnwrish/Eyxaristies

* Megala kommatia aytou toy kwdika anaptux8hkan sto kai gia to Panepisthmio toy Toronto. Polles eyxaristies ston Lee Oattes toy Tmhmatos Anaptyjhs Diktuwn toy panepisthmioy gia tis synexeis epoikodomhtikes kritikes toy.

* O kwdikas yposthrijhs ths PostgreSQL grafthke apo ton Adam Sussman

   • asussman@vidya.com

* Anari8mhtoi alloi, boh8hsan sto na elegx8ei kai na aposfalmatw8ei to paketo.

16.3 PHP 3 - Suntomo Istoriko

To PHP jekinhse thn zwh toy ws cgi kwdikas epikalychs (cgi wrapper) grammenos se Perl. Den proorizotan gia tipota pera apo proswpikh xrhsh. To onoma toy prwtoy aytou paketoy htan Personal Home Page Tools, kai argotera egine Personal Home Page Construction Kit.

Grafthke ena ergaleio gia na enswmatwnei eukola erwthseis SQL se web selides. Htan basika ena akoma CGI wrapper poy metefraze erwthseis SQL kai ekane thn dhmioyrgia formwn kai pinakwn apo tis erwthseis mia eukolh ypo8esh. To ergaleio ayto onomasthke FI (Form Interpreter).

To PHP/FI ekdosh 2.0 einai ena eniaio programma, ej’oloklhroy janagrammeno, poy apotelei ton syndyasmo twn duo parapanw paketwn. Exei twra pia ejelix8ei se shmeio poy einai mia aplh programmatistikh glwssa enswmatwmenh se arxeia HTML. To arxiko akrwnumio, PHP, emeine. Den einai kan antiproswpeytiko pia. To PHP/FI xrhsimopoieitai perissotero apo oloklhra web sites shmera, para gia mikres egkatastaseis Proswpikwn Selidwn (Personal Home Page). Me opoio onoma, ejaleifei thn anagkh gia ta polyari8ma mikra Perl cgi programmata, epitrepontas sas na balete mikra scripts apey8eias sta HTML arxeia sas. Ayto epitaxunei thn olikh taxuthta twn web pages sas, mia poy h ka8ysterhsh toy klwnismou (forking) ths Perl se pollapla antitypa exei ejaleif8ei. Kanei epishs eykoloterh thn diaxeirish megalwn web sites topo8etwntas ola ta systatika mias web page se ena mono html arxeio. Enswmatwnontas yposthrijh gia diafores baseis, kanei thn anaptyjh selidwn-me-dynatothtes-xrhshs-bashs tetrimmenh. Polloi briskoyn thn enswmatwmenh fush toy programmatos polu eykoloterh para to na prospa8oun na dhmioyrgoun jexwrista arxeia HTML kai CGI.

Kata th diarkeia ayths ths tekmhriwshs, ka8e anafora sto PHP, FI h sto PHP/FI milaei gia to idio pragma. Oi diafora metaju toy PHP kai toy FI einai mono 8ema antilhchs. Kai ta duo xtizontai apo ton kwdika ths idias dianomhs. Twra to PHP/FI metonomasthke se PHP 3.

16.4 Ti mporw na kanw, loipon, me to PHP/FI ;

To prwto pragma poy 8a parathrhsete an trejete mia selida mesw toy PHP/FI einai oti pros8etei ena footer me plhrofories sxetika me ton ari8mo prosbasewn sth selida sas (an exete metaglwttisei thn katagrafh prosbasewn sto ektelesimo). Ayto einai ena polu mikro deigma toy ti mporei na kanei gia sas to PHP/FI. Paizei ton ejisoy shmantiko rolo toy metafrasth cgi se formes, apo ekei bgainei kai to FI meros toy onomatos. Gia paradeigma, an dhmioyrghsete mia forma se mia apo tis web selides sas, xreiazeste kati gia na epejergastei thn plhroforia se ayth th forma. Akomh kai an apla 8elete na perasete plhroforia se mia allh selida, 8a prepei na xrhsimopoihsete ena programma cgi gia na to kanete ayto. To PHP/FI kanei ejairetika eukolo to na parete dedomena apo mia forma kai na kanete kati me ayta.

16.5 Ena aplo paradeigma

As ypo8esoyme oti exete mia forma:

     <FORM ACTION="/cgi-bin/php.cgi/~userid/display.html" METHOD=POST>
     <INPUT TYPE="text" name="name">
     <INPUT TYPE="text" name="age">
     <INPUT TYPE="submit">
     <FORM>

To arxeio display.html 8a mporouse na periexei kati san to parakatw:

     < ?echo "Hi $ name, you are $ age years old!<p>" >

Einai toso aplo! To PHP/FI dhmioyrgei aytomata mia metablhth gia ka8e input field sth forma sas. Mporeite tote na xrhsimopoihsete aytes tis metablhtes sto arxeio ACTION URL.

To epomeno bhma afou exete katalabei pws na xrhsimopoieite tis metablhtes einai na jekinhsete na paizete me merika tags logikhs rohs stis selides sas. Gia paradeigma, an 8elate na emfanisete diaforetika mhnumata basismena se kati poy eisagei o xrhsths, 8a xrhsimopoiousate th logikh if/else. Sto parapanw paradeigma, mporoume na emfanisoyme diaforetika pragmata me bash thn hlikia poy edwse o xrhsths allazontas to arxeio display.html ws ejhs:

     <?
         if($age>50);
             echo "Hi $name, you are ancient!<p>";
         elseif($age>30);
             echo "Hi $name, you are very old!<p>";
         else;
             echo "Hi $name.";
         endif;
     >

To PHP/FI parexei mia polu isxyrh scripting glwssa poy 8a kanei polu perissotera ap’ oti kanoyn ta parapanw apla paradeigmata. Deite to tmhma sto ”PHP/FI Script Language” gia perissoteres plhrofories.

Mporeite na ka8orisete epishs sto PHP/FI poios epitrepetai na exei prosbash stis selides sas. Ayto epitygxanetai me mia enswmatwmenh o8onh ru8mishs. Me ayth 8a mporousate gia paradeigma na ka8orisete oti mono ta atoma apo sygkekrimena domains 8a mporoun na doyn tis selides sas, h 8a mporousate na dhmioyrghsete ena kanona poy 8a prostateye merikes selides sas me kwdiko. Deite to tmhma ”Elegxos prosbasewn” gia perissoteres plhrofories.

To PHP/FI einai epishs ikano na dexetai uploads arxeiwn apo opoiodhpote web browser symbato me RFC-1867. Ayto to xarakthristiko epitrepei se an8rwpoys na anebasoyn kai text kai binary arxeia. Me ton elegxo prosbasewn toy PHP/FI kai tis logikes synarthseis, exete plhrh elegxo panw sto poios epitrepetai na anebazei (upload) arxeia kai ti mporei na kanei me to arxeio afou to anebasei. Deite to tmhma ”File Upload” gia perissoteres plhrofories.

To PHP/FI yposthrizei to paketo bashs dedomenwn PostgreSQL. Yposthrizei enswmatwmenes SQL erwthseis sta .HTML arxeia sas. Deite to antistoixo tmhma sthn ”Yposthrijh ths PostgreSQL” gia perissoteres plhrofories.

To PHP/FI yposthrizei epishs kai to paketo bashs dedomenwn mysql. Yposthrizei enswmatwmenes SQL erwthseis sta .HTML arxeia sas. Deite to antistoixo tmhma sthn ”Yposthrijh ths mysql” gia perissoteres plhrofories.

16.6 CGI Redirection

16.6.1 Shmeiwseis gia ton Apache 1.0.x

Enas kalos tropos na trejete to PHP/FI einai xrhsimopoiwntas ena cgi redirection module me ton Apache server. Parakalw shmeiwste oti de xreiazetai na anhsyxeite gia modules anakateu8ynshs an xrhsimopoieite thn ekdosh toy Apache module toy PHP/FI. Yparxoyn duo apo ayta ta modules anakateu8ynshs dia8esima. Ena apo ayta anaptux8hke apo ton Dave Andersen

   • angio@aros.net

kai einai dia8esimo sto

   • <ftp://ftp.aros.net/pub/util/apache/mod_cgi_redirect.c>

kai to allo erxetai paketo me ton Apache kai legetai mod actions.c. Ayta ta modules einai ejairetika paromoia. Diaferoyn elafra sth xrhsh toys. Kai ta duo exoyn testaristei kai doyleuoyn me to PHP/FI.

Deite thn tekmhriwsh toy Apache gia to pws mporeite na pros8esete ena module. Genika, pros8etete to onoma toy module se ena arxeio poy onomazetai Configuration. H grammh poy prepei na pros8esete an 8elete na xrhsimopoihsete to module mod actions einai:

Module action module mod actions.o

An xrhsimopoieite to module mod cgi redirect.c pros8este ayth th grammh:

Module cgi redirect module mod cgi redirect.o

Sth synexeia, metaglwttiste to httpd kai egkatasthste to. Gia na ry8misete to cgi redirection xreiazetai eite na dhmioyrghsete ena neo tupo mime sto arxeio sas mime.types eite na xrhsimopoihsete thn entolh AddType sto arxeio sas srm.conf gia na pros8esete ton mime tupo. Gia na pros8esete ton tupo mime 8a prepei na exete kati san to parakatw:

          application/x-httpd-php phtml

An xrhsimopoieite to module mod actions.c, xreiazetai na pros8esete thn parakatw grammh sto arxeio sas srm.conf :

          Action application/x-httpd-php /cgi-bin/php.cgi

An xrhsimopoieite to mod cgi redirect.c 8a prepei na pros8esete thn parakatw grammh sto arxeio srm.conf :

          CgiRedirect application/x-httpd-php /cgi-bin/php.cgi

Mhn xrhsimopoihsete taytoxrona kai ta duo mod actions.c kai mod cgi redirect.c.

Afou exete egkatasthsei ena apo ta cgi redirection modules kai ta ry8misete swsta, 8a mporeite na prosdiorisete oti 8elete ena arxeio na ginei parsed apo to php/fi apla allazontas to extension toy arxeioy se .phtml. Epipleon, an pros8esete ena index.phtml sth grammh DirectoryIndex toy arxeioy sas srm.conf, tote h top-level selida ston katalogo 8a ginei aytomata parsed apo to php an to index arxeio onomazetai index.phtml.

16.6.2 Netscape HTTPD

Mporeite na anakatey8unete aytomata tis aithseis gia arxeia me sygkekrimenh katalhjh arxeioy wste na ta xeiristei to PHP/FI me th xrhsh toy Netscape Server CGI Redirection module. Ayto to module einai dia8esimo sto ”File Archives” sth selida toy PHP/FI. To arxeio README poy yparxei mesa sto paketo ejhgei ka8ara pws na to ry8misete gia xrhsh me to PHP/FI.

16.6.3 NCSA HTTPD

O NCSA den yposthrizei pros to parwn modules, kai etsi gia na kanoyme anakateu8ynsh cgi me ton server ayton, 8a xreiasteite na tropopoihsete ton kwdika toy server sas. Mia dior8wsh/mpalwma (patch) poy to kanei gia ton NCSA 1.5 diati8etai sta arxeia toy site toy PHP/FI.

16.7 Trexontas to PHP/FI apo th grammh entolwn

An xtisete th CGI ekdosh toy PHP/FI, mporeite na to xrhsimopoihsete apo th grammh entolwn apla grafontas: php.cgi filename opoy to filename einai to arxeio poy 8elete na kanete parse. Mporeite na dhmioyrghsete epishs standalone PHP/FI scripts grafontas sthn prwth grammh toy script sas to ejhs:

         #!/usr/local/bin/php.cgi -q

To ”-q” apagoreuei thn ektupwsh twn HTTP headers. Mporeite na afhsete ejw ayth thn epilogh an 8elete.

17 Diasundesh me PostgreSQL mesw Python

O Python einai mia scripting glwssa, antikeimenostrafhs, se morfh metafrasth (interpreted). Enas aplos sth xrhsh (eukolh suntajh, aples kai profaneis dhlwseis) kai exei polles epektaseis gia thn dhmioyrgia grafikwn diasyndesewn (GUIs), epikoinwnia me to WWW, klp. Enas ejypnos web browser (tupoy HotJava) brisketai se anaptyjh (Noembrios. 1995) kai ayto 8a anoijei stoys programmatistes polles portes. O python einai pneymatikhs idiokthsias toy Stichting S Mathematisch Centrum, Amsterdam. The Neverlands kai einai eleu8erhs anadianomhs.

Yposthrizei dynamiko fortwma antikeimenwn, klasewn, modules, kai ejairesewn (exceptions). Profanhs einai h pros8hkh diasyndesewn me nees biblio8hkes mesw kwdika C, pragma poy kanei ton Python eukola katallhlo gia idiomorfes ry8miseis.

O Python einai mia scripting glwssa ychlou epipedoy me X interface. O Python dianemetai me ta Linux cdroms poy perilambanoyn ta perissotero stantar Python modules, mazi me modules gia diasundesh me to sunolo Tix widget gia thn Tk.

To PyGreSQL einai ena python interface gia thn PostgreSQL. Enswmatwnei thn biblio8hkh erwthsewn PostgreSQL gia na epitrepei thn eukolh xrhsh twn panisxyrwn dynatothtwn ths PostgresSQL mesa apo Python scripts. To PyGreSQL grafthke apo ton D’Arcy J.M. Cain kai ton Pascal Andre.

• Neo site ths PyGreSQL <http://www.druid.net/pygresql/>
• Synthreitai apo ton D’Arcy at <http://www.druid.net/~darcy/>
• To palio site einai sto <ftp://ftp.via.ecp.fr/pub/python/contrib/Database/PyGres95.README>
• D’Arcy J.M. Cain darcy@druid.net
• Pascal Andre andre@chimay.via.ecp.fr
• Pascal Andre andre@via.ecp.fr

17.1 Pou mporw na brw to PyGres ;

Ta home sites twn diaforetikwn paketwn einai:

• Python <ftp://ftp.python.org:/pub/www.python.org/1.5/python1.5b2.tar.gz>
• PyGreSQL <ftp://ftp.druid.net/pub/distrib/PyGreSQL-2.1.tgz>
• Old site <ftp://ftp.via.ecp.fr/pub/python/contrib/Database/PyGres95-1.0b.tar.gz>

8a prepei na cajete na breite kapoio mirror site konta sthn perioxh sas. Anafer8eite sta plhroforiaka arxeia gia to pou 8a breite ayta ta sites. To PyGres95 8a prepei na brisketai stoys katalogoys contrib twn sites twn Python kai PostgreSQL.

17.2 Plhrofories kai yposthrijh

An xreiazeste perissoteres plhrofories gia ayta ta paketa, episkefteite parakalw ta web sites toys:

• Python : <http://www.python.org/>
• PostgreSQL : <http://epoch.cs.berkeley.edu:8000/postgres95/index.html>
• PyGreSQL <ftp://ftp.druid.net/pub/distrib/PyGreSQL-2.1.tgz>
• Old site PyGreSQL : <http://www.via.ecp.fr/via/products/pygres.html>

Gia yposthrijh :

• Lista allhlografias gia PyGreSQL. Mporeite na eggrafeite stelnontas mhnyma sto majordomo@vex.net me thn grammh ”subscribe pygresql name@domain” sto swma toy mhnumatos antika8istwntas to ”name@domain” me thn dikh sas hlektronikh dieu8ynsh allhlografias.

• Newsgroup for Python : newsgroup comp.lang.python

• PyGreSQL : epikoinwnhste me ton Andre sto andre@via.ecp.fr gia anafores sfalmatwn, idewn, sxoleiwn

18 Epikoinwnia metaju PostgreSQL kai WWW - WDB-P95

18.1 Sxetika me to wdb-p95

WDB-P95 - Ena Web interface gia baseis PostgreSQL apo ton J. Douglas Dunlop Brisketai sto

   • Neo WDB apo ton J Rowe brisketai sto <http://www.lava.net/beowulf/programming/wdb>
   • Nees ekdoseis toy WWW-WDB sto <http://www.eol.ists.ca/~dunlop/wdb-p95/>

• Gia erwthseis h gia eggrafh stis Listes Allhlografias, epikoinwnhste me ton dunlop@eol.ists.ca

Einai mia tropopoihmenh ekdosh toy wdb-1.3a2 poy parexei mia sundesh sto WWW gia thn PostgreSQL. Ayth h ekdosh apaitei epishs ena Browser ikano na xeirizetai pinakes HTML gia thn ejodo se pinakes (tabular output). Ayto den apaiteitai apo to arxiko wdb kai mporei na epanafer8ei sthn palia morfh toy sxetika eukola.

Mporeite na dokimasete ta CASI Tape kai Image Query. Mporeite na rijete mia grhgorh matia sto Form Definition File (FDF) poy xrhsimopoihsa gia na ftiajw ta CASI Tape kai Image Query epishs, poy perilambanei ena JOIN 2 pinakwn.

Ayth h ekdosh periexei ola ta aparaithta arxeia gia thn egkatastash kai ektelesh toy WDB-P95 san diasundesh me tis PostgreSQL baseis sas. H metafora toy systhmatos se allh bash 8a prepei na einai sxetika eukolh - ypo thn proupo8esh pws yposthrizei stantar SQL kai exei interface se Perl.

18.2 Einai aparaithto o diakomisths ths PostgreSQL, to pgperl, kai to httpd na einai ston idio host;

Oxi - o diakomisths ths PostgreSQL diakomisths de xreiazetai na einai sto idio host. To WDB-P95 epeidh kaleitai apo ton http daimona, prepei na einai sto idio host - kai ka8ws to WDB-P95 grafthke gia na xrhsimopoiei to Pg.pm - to pgperl prepei na einai sto idio host epishs. To Pgperl grafthke xrhsimopoiwntas th biblio8hkh libpq, etsi mporei na exei prosbash se opoiodhpote diakomisth PostgreSQL opoydhpote sto diktyo, opws opoiosdhpote allos pelaths PostgreSQL. Opws fainetai parakatw

(WWW Client (Netscape)) => (HTTP Server (NCSA’s http) + WDB-P95 + pgperl + libpq)=> (PostgreSQL server)

Oi paren8eseis () anaparistoun mhxanhmata.

Ka8e mhxanhma mporei na einai diaforetikou tupoy : NT, SUN, HP, ... alla xreiazeste th biblio8hkh diasundeshs libpq gia ton tupo mhxanhmatos poy skopeuete na xrhsimopoihsete to WDB-P95, gia na metaglwttisete to pgperl. (To susthma sxediasthke gia na xrhsimopoiei HTML pinakes gi’ ayto einai protimoteros enas prosfatos WWW client).

19 Programmatistikes diasyndeseis gia ”C”, ”C++”, ESQL/C kai Dyadikoi Telestes gia thn PostgreSQL

19.1 Diasundesh glwssas ”C” me thn PostgreSQL

Symperilambanetai sth dianomh kai onomazetai ’libpq’. Einai paromoio me ta Oracle OCI, Sybase DB-lib kai tis biblio8hkes Informix CLI .

19.2 Interface glwssas ”C++” gia thn PostgreSQL

Symperilambanetai sth dianomh kai onomazetai ’libpq++’.

19.3 ESQL/C gia PostgreSQL

O ’Enswmatwmenos prometaglwttisths C’ gia thn PostgreSQL, ESQL/C einai opws to Oracle Pro*C, kai to Informix ESQL/C. To PostgreSQL ESQL/C einai ena programmatistiko periballon diasundeshs (API) meSQL, poy epitrepei ston programmatisth C na dhmioyrgei eidikes efarmoges me dynatothtes diaxeirishs ths bashs dedomenwn. Sas epitrepei na xrhsimopoieite mia glwssa triths geneas me thn opoia eisaste ejoikeiwmenos kai na ekmetalleueste parallhla kai ta pleonekthmata ths Domhmenhs Glwssas Erwthsewn (SQL).

To ESQL/C apoteleitai apo ta parakatw kommatia logismikou:

• Tis biblio8hkes ESQL/C me synarthseis C poy dinoyn prosbash pros ton diakomisth ths bashs dedomenwn (database server).

• Ta arxeia epikefalidwn toy ESQL/C poy dinoyn toys orismous gia tis domes dedomenwn, tis sta8eres, kai makroentoles xrhsimes gia to programma ESQL/C.

• O proepejergasths ESQL/C, einai enas proepejergasths phgaioy kwdika poy metatrepei ena C arxeio poy periexei entoles SQL se ena ektelesimo arxeio.

Brisketai sto

• H ESQL/C gia thn PostgreSQL perilambanetai stis diafores dianomes.

   • To kurio site einai <ftp://ftp.lysator.liu.se/pub/linus>
   • Email : linus@epact.se

19.4 Dyadikoi Telestes gia thn PostgreSQL

Oi dyadikoi telestes grafthkan apo ton Nicolas Moldavsky

   • nico@overnet.com.ar

Oi ”C” synarthseis poy ylopoioun toys dyadikous telestes (AND, OR, XOR, symplhrwma ws pros 2) se pgsql. Mporeite na ta katebasete me anonymous FTP apo to

   • <ftp://ftp.overnet.com.ar/pub/utils/linux/bitpgsql.tgz>

Perilambanetai Makefile gia Linux.

20 Japanese Kanji Kwdikas gia thn PostgreSQL

Brisketai sto parakatw site

   • <ftp://ftp.sra.co.jp/pub/cmd/postgres/>

21 Metafora ths PostgreSQL se Windows 95/Windows NT

H metafora sta Windows 95/Windows NT einai se ejelijh. H metafora ginetai xrhsimopoiwntas to gcc kai to gmake gia Win NT/95. Gia na metaglwttisoyme ton phgaio kwdika se win32 xrhsimopoioume to programma gnu-win32. To GNU gcc einai dia8esimo gia win32. Phgainete sto site -

   • <http://www.cygnus.com/misc/gnu-win32>

kai katebaste to arxeio cdk.exe (ayto-aposympiezomeno arxeio gia gnu-win32)

H metafora mporei epishs na ginei xrhsimopoiwntas to akoloy8o ergaleio ”Unix-Emulator on NT” apo to

   • <http://www.softway.com>

22 Listes allhlografias

22.1 Apokthste ena dwrean logariasmo e-mail

Elegjte tis dwrean prosfores - apokthste dwrean logariasmous e-mail apo ta

• Yahoo <http://www.yahoo.com> klikarete sto e-mail

• Lycos <http://www.lycos.com> klikarete stoys neoys logariasmous e-mail (new email accounts)

• hotmail <http://www.hotmail.com> klikarete stoys neoys logariasmous e-mail (new email accounts)

Grafteite sth lista allhlografias ths PostgreSQL kai to Yahoo sas dinei thn epipleon dynatothta na dhmioyrghsete ena jexwristo fakelo gia ta e-mails ths PostgreSQL, etsi wste ta na mhn anakatwnontai me ta alla proswpika sas e-mail. Epilejte to menou Email- > Options- > Filters kai dialejte jexwristo fakelo gia email. Me ayto to logariasmo e-mail mporeite na pairnete h na stelnete mail apo opoydhpote ston kosmo efoson exete prosbash se web selida.

An exete kapoio allo e-mail, mporeite na xrhsimopoihsete thn epilogh ”Mail Filters” gia na lambanete aytomata ta mails ths PostgreSQL se jexwristo fakelo. Me ayto ton tropo ta mails sas einai kalutera organwmena kai apofeugete kai to anakatema toys.

22.2 Agglikh Lista Allhlografias

Deite tis Listes Allhlografias sthn kentrikh selida sto web sto :

   • <http://www.postgresql.org/>
   • Erwthseis mesw Email sto: pgsql-questions@postgresql.org
   • Developers pgsql-hackers@postgresql.org
   • Port specific questions pgsql-ports@postgresql.org
   • Documentation questions pgsql-docs@postgresql.org

8a labete apanthseis mesw e-mail se ligotero apo mia mera!!

Mporeite na grafteite epishs se listes allhlografias. Deite epishs to parapanw tmhma ’Apokthste ena dwrean logariasmo e-mail’. Gia na grafteite h na jegrafteite apo mia lista, steilte mail sta

   • pgsql-questions-request@postgresql.org
   • pgsql-hackers-request@postgresql.org
   • pgsql-ports-request@postgresql.org
   • pgsql-docs-request@postgresql.org

To kyriws tmhma (body) toy mhnumatos 8a periexei mono thn akoloy8h grammh subscribe (h) unsubscribe

22.3 Arxeio ths Listas Allhlografias

Krateitai arxeio twn listwn allhlografias se html morfh stis parakatw diey8unseis -

• Dia8esimh lista me bash tis diey8unseis mesw MHonarc kai WWW sto <http://www.postgresql.

     org/mhonarc/pgsql-questions>

• <ftp://ftp.postgresql.org> ston katalogo /pub/majordomo

22.4 Ispanikh Lista Allhlografias

Yparxei twra kai mia ”anepishmh” lista gia thn postgreSQL sta ispanika. Deite epishs to parapanw tmhma ’Dwrean Logariasmos gia na organwsete ta e-mails ths PostgreSQL’ . Gia na eggrafeite, prepei na steilete ena mhnyma sto:

   • majordomo@tlali.iztacala.unam.mx

To kyriws tmhma (body) toy mhnumatos 8a periexei mono thn akoloy8h grammh: inscripcion pgsql-ayuda

23 Tekmhriwsh kai Bibliografia

23.1 Odhgoi ekma8hshs kai Egxeiridia

Ta parakatw symperilambanontai sth dianomh ths PostgreSQL se morfh postscript kai se unix selides boh8eias (man-pages). An exete prosbash sto internet, mporeite na breite ta keimena poy anaferontai

parakatw sto <http://www.postgresql.org/docs>

• ”Odhgos Egkatastashs”

• ”Odhgos xrhshs” gia thn PostgreSQL

• ”Odhgos anaptyjhs-ylopoihshs” me leptomereies gia tis eswterikes leitoyrgies ths PostgreSQL.

• Online egxeiridia.

• Online egxeiridia se HTML morfh.

• Epishs, egxeiridia se morfh Postscript gia ektupwsh.

23. Tekmhriwsh kai Bibliografia 49

23.2 Online Tekmhriwsh

• Lista kai perigrafh twn proka8orismenwn tupwn dedomenwn kai telestwn

Einai tmhma twn entolwn PSQL sthn ekdosh 6.4.

• Lista twn yposthrizomenwn SQL lejewn kleidia (keywords)

Yparxei ena script ston katalogo /tools gia na to kanete ayto

• Listes twn yposthrizomenwn entolwn -

Xrhsimopoihste thn entolh psql \h

• Basikes ennoies sxesiakhs bashs dedomenwn gia PostgreSQL (ylopoihsh) kai arketa online paradeigmata

(erwthseis) -

Koitajte sta regression tests sto src/test. Ekei 8a breite toys katalogoys
regress/sql kai suite/*.sql.

• Odhgos ekma8hshs gia thn PostgreSQL.

8a breite SQL scripts gia ekma8hsh ths SQL ston katalogo src/tutorial

Deite epishs to ”Odhgos ekma8hshs SQL gia arxarioys” sto Appendix B aytou toy keimenoy B ()

23.3 Xrhsimh Bibliografia Anaforas

• ”Understanding the New SQL: A Complete Guide” - apo toys Jim Melton kai Alan R.Simon

To Morgan Kaufman Publisher einai ena apo ta kalutera biblia gia SQL. Asxoleitai me thn SQL92.

• ”A Guide to THE SQL STANDARD” - apo ton C.J.Date

H etaireia Addison-Wesley Publishing exei epishs polu kala biblia. Polu dhmofilh biblia gia SQL.

• SQL - The Standard Handbook, Noembrios 1992

Stephen Cannan kai Gerard Otten
McGraw-Hill Book Company Europe , Berkshire, SL6 2QL, England

• SQL Instant Reference, 1993

Martin Gruber, Technical Editor: Joe Celko
SYBEX Inc.  2021 Challenger Drive Alameda, CA 94501

• C.J.Date, ”An introduction to Database Systems” (6th Edition), Addison-Wesley, 1995, ISBN 0-201-

82458-2

Ayto to biblio einai h Biblos ths Diaxeirishs Systhmatwn basewn Dedomenwn.
Periexei plhrofories gia kanonikopoihsh, SQL, recovery, concurrency, asfaleia,
integrity, kai extensions sto arxiko sxesiako montelo, trexonta 8emata
opws client/server systhmata kai Antikeimenostrafh montela. Polles
anafores symperilambanontai gia osoys 8eloyn na ma8oyn perissotera. To synistoume stoys perissoteroys xrhstes.

• Stefan Stanczyk, ”Theory kai Practice of Relational Databases”, UCL Press Ltd, 1990, ISBN 1-857-

28232-9

Periexei leptomereies me 8ewria sxesiakwn basewn, sxesiakh algebra, calculus
kai kanonikopoihsh. Alla den kaluptei 8emata toy pragmatikou kosmoy kai paradeigmata pio sun8eta. To synistoume stoys perissoteroys xrhstes.

• ”The Practical SQL Handbook” Trith Ekdosh, Addison Wesley Developers Press ISBN 0-201-44787-8

       To synistoume stoys perissoteroys xrhstes.

• Michael Stonebraker, ”Readings in Database Systems”, Morgan Kaufmann, 1988, ISBN 0-934613-65-6

       To biblio einai mia syllogh apo xartia poy exoyn dhmosieytei ola ta xronia sxetika me baseis. Den einai gia ton aplo xrhsth alla einai mia kalh anafora gia proxwrhmenoys (metaptyxiakous) foithtes h programmatistes systhmatwn basewn dedomenwn.

• C.J.Date, ”Relational Database - Selected Readings”, Addison-Wesley, 1986, ISBN 0-201-14196-5

       To biblio einai mia syllogh apo xartia poy exoyn dhmosieytei ola ta xronia sxetika me baseis. Den einai gia ton aplo xrhsth alla einai mia kalh anafora gia proxwrhmenoys (metaptyxiakous) foithtes h programmatistes systhmatwn basewn dedomenwn.

• Nick Ryan kai Dan Smith, ”Database Systems Engineering”, International Thomson Computer Press,

1995, ISBN 1-85032-115-9

       Ayto to biblio exei leptomereies gia me8odoys prosbashs, kai texnikes apo8hkeyshs.

• Bipin C. Desai, ”An introduction to Database Systems”, West Publishing Co., 1990, ISBN 0-314-

66771-7

       Den einai gia ton aplo xrhsth alla einai mia kalh anafora gia proxwrhmenoys (metaptyxiakous) foithtes h programmatistes systhmatwn basewn dedomenwn.

• Joe Celko ”INSTANT SQL Programming”

       Wrox Press Ltd.
       Unit 16, 20 James Road, Tyseley
       Birmingham, B11 2BA, England
       1995

• Michael Gorman ”Database Management Systems: Understanding kai Applying Database”

       Technology
       QED kai John Wiley
       1991

• Michael Gorman ”Enterprise Database for a Client/Server Environment” QED kai John Wiley

       Paroysiazei tis apaithseis gia na ftiajete client/server efarmoges basewn
       mesw repository metamontelwn  kai ths xrhshs ANSI stantar SQL
       1993

Ekatontades alloi titloi einai dia8esimoi gia SQL ! Koitajte sta bibliopwleia.

23.4 Keimena prodiagrafwn ANSI/ISO SQL - SQL 1992, SQL 1998

Mporeite na breite keimena prodiagrafwn ANSI/ISO SQL sta parakatw sites -

• <http://www.naiua.org/std-orgs.html>

• <http://www.ansi.org/docs> kai klikarete sto arxeio cat c.html kai cajte gia ”Database SQL”

• SQL92 standard <http://www.jcc.com> kai klikarete sto arxeio sql stnd.html

• ANSI/ISO SQL prodiagrafes <http://www.contrib.andrew.cmu.edu/~shadow/sql.html> Edw 8a

breite egxeiridio gia SQL.

23.5 Suntajh ANSI/ISO SQL 1992

Deite to Appendix A aytou toy keimenoy A ()

23.6 Suntajh ANSI/ISO SQL 1998

Oi prodiagrafes SQL 1998 (SQL 3) einai akomh ypo anaptyjh. Deite to ’Electronic Access to the SQL3 Working Draft’ aytou toy keimenoy sto 23.9 ()

23.7 Odhgos ekma8hshs SQL gia arxarioys

Deite to Appendix B aytou toy keimenoy B ()

23.8 Proswrinh epektash (extension) sto SQL92

   • Keimeno gia proswrinh epektash SQL-92 <ftp://FTP.cs.arizona.edu/tsql/tsql2/>
   • Proswrines prodiagrafes SQL-3 <ftp://FTP.cs.arizona.edu/tsql/tsql2/sql3/>

O katalogos periexei tis prodiagrafes ths glwssas gia thn proswrinh epektash sth stantar glwssa SQL-92. Ayth h nea glwssa onomazetai TSQL2.

Oi prodiagrafes ths glwssas poy paroysiazontai edw einai h telikh ekdosh ths glwssas.

H allhlografia mporei na stalei ston proedro toy TSQL2 Language Design Committee, Richard T.Snodgrass, Department of Computer Science, University of Arizona, Tucson, AZ 85721,

   • rts@cs.arizona.edu

Oi 8ygatrikes kai oi diey8unseis e-mail twn melwn toy TSQL2 Language Design Committee mporoun na bre8oun se jexwristo tmhma sto telos twn prodiagrafwn ths glwssas.

Ta periexomena aytou toy katalogoy einai opws paroysiazontai parakatw.

spec.dvi,.ps Prodiagrafes Glwssas TSQL2, ekdo8hke to Septembrio toy 1994

bookspec.ps Prodiagrafes ths Glwssas TSQL2, opws emfanisthkan sto biblio TSQL2, poy ekdo8hke to Septembrio toy 1995 (deite parakatw).

sql3 allagh twn protasewn poy ypoblh8hkan stis epitropes ANSI kai ISO SQL3.

Mazi me tis prodiagrafes ths glwssas exei sysxetistei mia syllogh apo sxolia poy aforoun se apofaseis sxediasmou, paroxh paradeigmatwn, kai apoceis gia to pws mporei na ylopoih8ei h glwssa. Ayta ta sxolia htan arxika protaseis sthn epitroph toy TSQL2 Language Design. Twra ejyphretoun ena sygkekrimeno skopo: na parexoyn paradeigmata toy oti exei ftiaxtei, w8hsoyn tis polles apofaseis poy par8hkan kata to sxediasmo ths glwssas, kai na sygkrinoyn thn TSQL2 me polles alles protaseis ths glwssas poy exoyn ginei ta thn teleytaia dekapentaetia. 8a prepei na do8ei emfash oti ayta ta sxolia den einai tmhma twn prodiagrafwn ths glwssas TSQL2, alla th symplhrwnoyn kai anaptussoyn me bash ayta. Oi katallhles prodiagrafes ths glwssas einai h teleytaia lejh sthn TSQL2.

Ta sxolia, mazi me tis prodiagrafes ths glwssas , arketoi deiktes (indexes), kai allo yliko yposthrijhs, exoyn ekdo8ei se ena biblio:

Snodgrass, R.T., editor, The TSQL2 Temporal Query Language, Kluwer Academic Publishers, 1995, 674+xxiv selides.

Oi kritikes emfanizontai sto biblio se mia syntomeymenh morfh. Oi kritikes parexontai plhreis se ayton katalogo sto arxeio eval.ps

To arxeio tl2tsql2.pl einai ena programma se prolog poy metafrazei thn epitrepomenh proswrinh logikh se TSQL2. Ayto to programma grafthke apo ton Michael Boehlen

   • boehlen@iesd.auc.dk

Mporeite na epikoinwnhsete mazi toy gia ena paper poy perigrafei ayth th metafrash. Ayto einai mallon mia dated ekdosh toy programmatos. Newteres ekdoseis einai dia8esimes sto

   • <http://www.cs.auc.dk/general/DBS/tdb/TimeCenter/Software>

(ta systhmata TimeDB kai Tiger).

23.9 Tmhma 0 - Apoktwntas ta keimena ISO/ANSI SQL

Ayto to keimeno sas deixnei pws na apokthsete (nomima) ena antigrafo toy protupoy SQL-92 kai toy ”trexontos” SQL3 Working Draft.

Sto ANSI protypo exei pneymatika dikaiwmata h ANSI, sto protypo ISO h ISO.

Yparxoyn duo (2) trexonta protypa SQL, h dhmosieysh ANSI kai h dhmosieysh ISO. Ta duo ayta protypa einai oloidia lejh pros lejh ektos apo tetrimmena zhthmata opws o titlos toy keimenoy, oi epikefalides ths selidas, h frash ”International Standard” anti gia ”American Standard”, kai loipa.

Agorazontas to protypo SQL-92

To protypo ISO standard, ISO/IEC 9075:1992, Information Technology - Database Languages - SQL, einai dia8esimo (Martios, 1993) sto ANSI :

          American National Standards Institute
          1430 Broadway
          New York, NY 10018 (USA)
          Phone (sales): +1.212.642.4900

kai kostizei US$230.00. H ANSI ekdosh, ANSI X3.135-1992, American National Standard gia Systhmata Plhroforiwn - Database Language SQL, den htan dia8esimo pros pwlhsh otan grafthke ayto to keimeno, alla anamenotan na einai dia8esimo metaju telh Martioy kai arxes Maioy, 1993). To kostos toy anamenetai gurw sta US$225.00.

An agorasete kapoio apo ta keimena apo to ANSI, 8a exete ejtra xrewsh gia ejoda metaforas 7% epipros8eta (dhladh, peripoy US$9.10). Gia xwres ejwterikou ta ejoda metaforas 8a einai anamfibola akomh perissotera. To ANSI apaitei ka8e paraggelia na synodeuetai apo ena xarti paraggelias ths etaireias. Enallaktika, mporeite na steilete ena tsek amerikanikhs trapezas h se amerikanika dolaria, ta opoia 8a metrh8oun prin na stal8ei h paraggelia sas. (Yparxei mia ejairesh: an h etaireia sas einai enswmatwmeno melos toy ANSI, tote to ANSI 8a sas steilei ta keimena kai 8a xrewsei thn etaireia sas.)

To protypo ISO einai epishs dia8esimo ektos Amerikhs apo e8nika topika tmhmata (tmhmata protypopoihshs ana xwra) poy einai melh eite toy ISO (Die8nhs Organismos Typopoihshs - International Organization for Standardization) h toy IEC (Die8nhs Hlektrotexnikh Epitroph - International Electrotechnical Commission).

Antigrafa ths lista twn e8nikwn tmhmatwn kai oi diey8unseis toys einai dia8esimes apo to ANSI h apo alla e8nika tmhmata. Einai epishs dia8esima apo to ISO:

          International Organization for Standardization
          Central Secretariat
          1, rue de Varembi
          CH-1211 Genhve 20
          Switzerland

An protimate na paraggeilete to protypo me pio boliko kai grhgoro tropo, 8a prepei na plhrwsete gia na exete ayto to pronomio. Mporeite na paraggeilete to ISO/IEC 9075:1992, Information Technology - Database Languages - SQL, apo to:

          Global Engineering Documents
          2805 McGaw Ave
          Irvine, CA 92714 (USA)
          USA
          Thlefwno (apo opoiadhpote perioxh): +1.714.261.1455
          Thlefwno (mono gia Amerikh): (800)854-7179

kai kostizei US$308.00. De jerw an se ayth thn timh symperilambanontai ta ejoda apostolhs h oxi, alla ypo8etw oti h apostolh sto ejwteriko (toylaxiston) 8a kostizei perissotero. Mporoun na sas steiloyn to keimeno arketa grhgora kai dexontai kai tis ”pio gnwstes pistwtikes kartes”. To Global den exei akomh thn ANSI ekdosh oute exoyn timh h mia anamenomenh hmeromhnia (an kai thn perimenw oti se merikes ebdomades meta th dhmosieysh toy ANSI kai me timh gurw sta US$300.00).

Agorazontas ena antigrafo toy SQL3 Working Draft

Mporeite na agorasete mia ektupwsh toy SQL3 working draft apo to ANSI X3 Secretariat, CBEMA (Computer kai Business Equipment Manufacturers Association). Synh8ws dia8etoyn tis ”pio prosfates ekdoseis” toy SQL3 working draft kai tis pwloun apo US$60.00 mexri US$65.00. Mporeite na epikoinwnhsete me to CBEMA sto:

          CBEMA, X3 Secretariat
          Attn: Lynn Barra
          1250 Eye St.
          Suite 200
          Washington, DC 20005 (USA)

Mporeite na epikoinwnhsete me th Lynn Barra thlefwnikws sto +1.202.626.5738 gia na zhthsete ena antigrafo, an kai to mail einai protimotero.

Hlektronikh prosbash sto SQL3 Working Draft

H pio prosfath ekdosh (th stigmh ths syggrafhs toy keimenoy) toy SQL3 (kai gia ANSI kai ISO) working draft (kai ola ta tmhmata toy) einai dia8esimh me ”anonymous ftp” h me ”ftpmail” apo to:

          gatekeeper.dec.com
       sto katalogo
          /pub/standards/sql/

Se ayton ton katalogo yparxoyn polla arxeia. Yparxoyn arxeia PostScript kai ”plain text” (oxi aparaithta formarismena, alla diabazontai se mia o8onh xwris idiaitero logismiko).

Genika, mporeite na breite arxeia me onomata opws:

          sql-bindings-mar94.ps
          sql-bindings-mar94.txt
          sql-cli-mar94.ps
          sql-cli-mar94.txt
          sql-foundation-mar94.ps
          sql-foundation-mar94.txt
          sql-framework-mar94.ps

   sql-framework-mar94.txt
   sql-psm-mar94.ps
   sql-psm-mar94.txt

Ka8ws paragontai nees ekdoseis twn keimenwn, to ”mar94” 8a allazei gia na deijei th nea hmeromhnia ths dhmosieyshs (p.x., ”aug94” einai h anamenomenh hmeromhnia ths epomenhs dhmosieyshs meta to ”mar94”).

Epishs, gia toys anagnwstes poy den mporoun na exoyn mia lista toy katalogoy me FTP, exoyme topo8ethsei ston idio katalogo ena arxeio me to onoma:

   ls

Ayto to arxeio (ekplhjh!) periexei th lista toy katalogoy.

Anaktwntas Arxeia katey8eian me xrhsh toy ftp

Ayto einai ena paradeigma gia to pws na xrhsimopoieite to FTP. Sygkekrimena, deixnei pws na synde8eite sto gatekeeper.dec.com, na pate ston katalogo opoy fylassetai to basiko keimeno, kai na metaferete to keimeno sto mhxanhma sas. Shmeiwste oti to mhxanhma sas prepei na exei prosbash sto Internet gia na to kanete ayto. To login einai ’ftp’ kai o kwdikos einai h email dieu8ynsh sas (ayto einai gnwsto kai san anwnymo ftp ’anonymous ftp’). H entolh ’type binary’ xrhsimopoieitai gia na sigoyrecete oti de 8a xasete kapoia bits apo to(a) arxeio(a) poy 8a labete. H ’get’ katebazei ena arxeio th fora. Ta sxolia sto parakatw script einai mesa se angle brackets < san ayta > .

% ftp gatekeeper.dec.com
Connected to gatekeeper.dec.com.
220- *** /etc/motd.ftp ***
     Gatekeeper.DEC.COM is an unsupported service of DEC Corporate Research.
     <...this goes on for a while...>
220 gatekeeper.dec.com FTP server (ekdosh 5.83 Sat ... 1992) ready.
Name (gatekeeper.dec.com:<yourlogin here>): ftp  <anonymous also works>
331 Guest login ok, send ident as password.
Password: <enter your email address here >
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.  <or whatever>
Using binary mode to transfer files.
ftp> cd pub/standards/sql
250 CWD command successful.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 9529
-r--r--r--  1 root     system     357782 Feb 25 10:18 x3h2-93-081.ps
-r--r--r--  1 root     system     158782 Feb 25 10:19 x3h2-93-081.txt
-r--r--r--  1 root     system     195202 Feb 25 10:20 x3h2-93-082.ps
-r--r--r--  1 root     system      90900 Feb 25 10:20 x3h2-93-082.txt
-r--r--r--  1 root     system    5856284 Feb 25 09:55 x3h2-93-091.ps
-r--r--r--  1 root     system    3043687 Feb 25 09:57 x3h2-93-091.txt
226 Transfer complete.
ftp> type binary
200 Type set to I.
ftp> get x3h2-93-082.txt
200 PORT command successful.
150 Opening BINARY mode data connection for x3h2-93-082.txt (90900 bytes).
226 Transfer complete.
90900 bytes received in 0.53 seconds (166.11 Kbytes/s)

       ftp> quit
       % <to arxeio einai twra ston katalogo sas san x3h2-93-082.txt>

Anaktwntas Arxeia xwris apey8eias yposthrijh ftp

H Digital Equipment Corporation, opws kai polles alles etaireies, parexei yphresia ftp email. H apanthsh mporei na xreiastei gia na ftasei arketes meres, alla parexei mia yphresia isodunamh me to ftp gia aytous poy den exoyn apey8eias ftp prosbash sto Internet. H dieu8ynsh toy server einai:

ftpmail@decwrl.dec.com

To parakatw script 8a anakthsei to PostScript arxeio ths teleytaias ekdoshs toy SQL3 keimenoy:

          reply joe.programmer@imaginary-corp.com
          connect gatekeeper.dec.com anonymous
          binary
          compress

To parakatw script 8a anakthsei to PostScript arxeio ths teleytaias ekdoshs toy SQL3 keimenoy:

          reply joe.programmer@imaginary-corp.com
          connect gatekeeper.dec.com anonymous
          binary
          compress
          uuencode
          chdir /pub/standards/sql
          get x3h2-93-091.ps
          quit

H prwth grammh apo tis entoles toy script zhta apo to diakomisth (server) na sas epistrecei ta zhtoumena arxeia. 8a prepei na antikatasthsete to ”joe.programmer@imaginary-corp.com” me thn dieu8ynsh sas sto Internet. To arxeio se ayto to paradeigma, x3h2-93-091.ps, epistrefetai se morfh ”compress”ed ”uuencode”d san 34 diaforetika mhnumata email. An to periballon sas den parexei ergaleia gia epanakataskeyh tetoiwn arxeiwn, tote mporeite na anakthsete to arxeio san plain text me to akoloy8o script:

          reply joe.programmer@imaginary-corp.com
          connect gatekeeper.dec.com anonymous
          chdir /pub/standards/sql
          get x3h2-93-091.ps
          quit

Alla sas proeidopoioume, to arxeio .ps polu pi8ana 8a stal8ei se perissotera apo 70 tmhmata!

Gia na anakthsete opoiodhpote allo sygkekrimeno arxeio, ektos toy x3h2-93-091.ps, apla antikatasthste to ”x3h2-93-091.ps” me to onoma toy arxeioy poy epi8ymeite. Gia na parete th lista olwn twn dia8esimwn arxeiwn toy katalogoy, antikatasthste to ”get x3h2-93-091.ps” me to ”dir”.

23.10 Tmhma 1 - Trexoysa katastash toy ISO/ANSI SQL

Ayto to kefalaio einai mia phgh plhroforias sxetika me thn protyph diergasia SQL kai thn trexoysa katastash ths.

Trexoysa katastash:

H anaptyjh toy einai ypo ejelijh gia na epekteinei thn SQL se mia oloklhrwmenh ypologistika glwssa gia ton ka8orismo kai diaxeirish persistent, sun8etwn antikeimenwn. Ayto perilambanei : generalization kai specialization hierarchies, pollaplh klhronomikothta, tupoys dedomenwn ka8orismenwn apo ton xrhsth, triggers kai assertions, yposthrijh gia empeira systhmata, anadromikes erwthseis, kai epipleon ergaleia diaxeirishs dedomenwn. Perilambanei epishs tis prodiagrafes twn afhrhmenwn tupwn dedomenwn (abstract data types -ADTs), object identifiers, me8odoys, klhronomikothta, polymorfismo, encapsulation, kai oles tis eykolies poy sxetizontai me th diaxeirish dedomenwn twn antikeimenwn.

To f8inopwro toy 1996, arketa tmhmata toy SQL3 perasan apo chfoforia ISO CD. Ayta htan ta SQL/Framework, SQL/Foundation, kai SQL/Bindings. Ayth h chfoforia apetyxe (opws htan anamenomeno) me 900 h peripoy tosa sxolia. Sta telh Ianoyarioy, egine kapoia synanthsh suntajhs toy ISO DBL kata thn opoia epejergasthkan luseis gia ena megalo ari8mo problhmatwn ta opoia eite enswmatw8hkan me sxolia mesw chfoforias eite stal8hkan san jexwrista papers. Mia kai h synanthsh suntajhs toy DBL den mporese na epejergastei ola ta sxolia, h synanthsh suntajhs parata8hke. H oloklhrwsh ths synanthshs suntajhs programmatisthke gia ta telh Ioylioy, 1997, sto Londino.

Meta th synanthsh suntajhs toy Ioylioy, anamenetai na zhth8ei mia telikh chfoforia gia ola ayta ta tmhmata ths SQL. H diadikasia gia thn telikh chfoforia 8a krathsei 6 peripoy mhnes kai 8a ginei mia synanthsh suntajhs DBL, meta thn opoia 8a ginei mia chfoforia DIS kai mia sxetika grhgorh chfoforia IS .

Oi diadikasies ISO exoyn allajei apo to SQL/92, etsi oi epitropes gia thn SQL doyleuoyn akomh gia ton ka8orismo twn akribwn leptomereiwn ths diadikasias.

An pane ola kala, ayta ta tmhmata ths SQL3 8a ginoyn ena epishmo protypo ISO/IEC sta telh toy 1998, alla to programma einai polu sfixto.

To 1993, oi epitropes anaptyjhs ANSI kai ISO apofasisan na xwrisoyn th mellontikh anaptyjh ths SQL se ena polymeres protypo. Ta tmhmata ayta einai:

• Tmhma 1: Framework Mia mh texnikh perigrafh gia to pws einai domhmeno to keimeno.

• Tmhma 2: Foundation Oi prodiagrafes toy systhmatos, symperilambanomenoy olwn twn newn xarakthristikwn ADT.

• Tmhma 3: SQL/CLI To Call Level Interface.

• Tmhma 4: SQL/PSM Oi prodiagrafes twn stored procedures, symperilambanomenwn ypologistikwn symplhrwsewn.

• Tmhma 5: SQL/Bindings Ta Dynamic SQL kai Embedded SQL bindings poy par8hkan apo to SQL-92.

• Tmhma 6: SQL/XA Oi prodiagrafes SQL toy dhmofilous XA Interface poy anaptussetai apo thn X/Open

• Tmhma 7:SQL/Temporal Pros8etei sta protypa SQL ikanothtes sxetikes me to xrono.

Sthn Amerikh, oloklhrh h SQL3 epejergazetai kai san ANSI Domestic (”D”) project kai san ISO project. To anamenomeno xroniko para8yro gia thn oloklhrwsh ths SQL3 einai to 1999.

Ta SQL/CLI kai SQL/PSM epejergazontai oso grhgorotera ginetai san addendums sthn SQL-92. Sthn Amerikh, ayta epejergazontai mono san Die8nh Erga (International - ”I”). H SQL/CLI oloklhrw8hke to 1995. H SQL/PSM prepei na exei oloklhrw8ei sta telh toy 1996.

Epipros8eta ths SQL3 ergasias, enas ari8mos epipleon ergwn are persued:

• SQL/MM Mia prospa8eia na oristoun protypa paketa polymeswn xrhsimopoiwntas tis dynatothtes ths SQL3 ADT.

• Prosbash se apomakrysmena dedomena - Remote Data Access (RDA)

Epitropes Protupwn kai Diadikasiwn Yparxei pragmatika megalos ari8mos epitropwn protupwn SQL se olo ton kosmo. Yparxei ena die8nes gkroyp toy protupoy SQL san tmhma toy ISO. Polles xwres exoyn epitropes poy asxolountai me thn SQL. Aytes oi xwres (synh8ws) stelnoyn antiproswpoys stis synanthseis ISO/IEC JTC1/SC 21/WG3 DBL. Oi xwres poy symmetexoyn energa sth diadikasia toy protupoy ISO SQL einai oi:

• Aystralia

• Brazilia

• Kanadas

• Gallia

• Germania

• Iapwnia

• Korea

• Ollandia

• Agglia

• Amerikh

NIST Nomimopoihsh Oi ylopoihseis ths SQL nomimopoiountai (sthn Amerikh) apo to E8niko Institouto Protupwn kai Elegxoy (NIST). To NIST exei gia thn wra ena sunolo apo test nomimothtas gia to entry level SQL-92. Oi akribeis plhrofories gia tis apaithseis ths NIST nomimopoihshs ka8orizontai ws Omospondiako Protypo Epejergasias Plhroforias - Federal Information Processing Standard (FIPS). Oi trexoyses apaithseis gia thn SQL orizontai sto FIPS 127-2. Mporeite na parete tis trexoyses Postscript kai Text ekdoseis aytou toy keimenoy apo to NIST. H lista twn trexontwn nomimopoihmenwn SQL proiontwn mporei epishs na bre8ei sto NIST. Ekdoseis kai Ar8ra sxetika me to protypo ths SQL Yparxoyn duo ekdoseis sxetika me to protypo SQL. Kai oi duo diati8entai apo to ANSI:

• ISO/IEC 9075:1992, ”Information Technology — Database Languages — SQL”

• ANSI X3.135-1992, ”Database Language SQL”

Oi dyo ekdoseis toy protupoy SQL einai oloidies ektos apo to ejwfyllo kai tis anafores se alla protypa. Kai oi duo diati8entai apo to :

          American National Standards Institute
          1430 Broadway
          New York, NY 10018
          USA
          Phone (sales): +1.212.642.4900

Epipros8eta sto protypo SQL-92, yparxei ena Technical Corrigendum (dior8wseis bug):

        * Technical Corrigendum 1:1994 to ISO/IEC 9075:1992

To TC 1 prepei na diati8etai epishs apo to ANSI. Yparxei mono h ISO ekdosh toy TC 1 – efarmozetai kai sthn ISO kai ANSI ekdosh toy SQL-92.

Epipros8eta, exoyn graftei arketa biblia sxetika me to protypo 1992 SQL. Ayta ta biblia parexoyn mia kalutera anagnwsimh perigrafh toy protupoy apo oti to idio to protypo.

Sxetizomena protypa

Enas sunolo protupwn endiaferoyn thn SQL koinothta. Ayto to tmhma periexei deiktes se plhrofories gia aytes tis prospa8eies. Aytoi oi deiktes 8a ayjh8oun ka8ws ejtra plhrofories diati8entai sto web.

• Periballonta SQL (FIPS 193)

• Repository Systhmata Epomenhs Genias (X3H4) - mia News Release poy zhta symmetoxh sto ”Anaptussontas Protypa gia Repository Systhmata Epomenhs Genias.”

23.11 Tmhma 2 - ISO/ANSI SQL Foundation

Ena shmantiko tmhma ths SQL3 prospa8eias brisketai sto keimeno SQL Foundation :

• Basikes dynatothtes SQL/PSM (moved form SQL/PSM-92)

• Neoi tupoi dedomenwn

• Triggers

• Ypopinakes

• Afhrhmenoi Tupoi Dedomenwn - Abstract Data Types (ADT)

• Antikeimenostrafeis Dynatothtes

Yparxoyn arketa proapaitoumena stis antikeimenostrafeis dynatothtes:

• Ikanothta na orizete sun8etes leitoyrgies

• Apo8hkeysh sun8etwn leitoyrgiwn sth bash

• Klhsh ejwterikwn diadikasiwn Merikes leitoyrgies mporei na mhn einai se SQL, h mporei na apaitoun ejwterikes parembaseis

Aytes oi dynatothtes orizontai san tmhma toy SQL/PSM

Ginetai mia shmantikh ergasia gia na ekka8aristei to montelo antikeimenoy SQL-3 kai na ey8ygrammistei me to montelo antikeimenoy poy prota8hke apo to ODMG. Ayth h prospa8eia perigrafetai sto X3H2 kai ISO DBL paper: Accomodating SQL3 and ODMG. Einai epishs dia8esimh mia prosfath ekdosh sto SQL3/OQL Merger.

SQL3 Timing

H ergasia panw sto SQL3 brisketai se ejelijh, alla ta telika protypa 8a xreiastoun xronia akomh gia na oloklhrw8oun.

• Die8nhs chfoforia gia thn proodo toy SQL3 Foundation apo to Proxeiro Entypo Ergasias ws to Proxeiro Entypo Epitrophs (Committee Draft - CD) elabe xwra to f8inopwro toy 1996.

• H chfoforia anamenetai na prokalesei polla sxolia • Einai pi8ano na zhth8ei mia deuterh chfoforia CD

• Mia Draft Yhfoforia Die8nwn Protupwn einai pi8ano na ginei sta mesa toy 1998

• To Die8nes Protypo mporei na oloklhrw8ei sta mesa toy 1999.

H ANSI ekdosh toy protupoy exei paromoio xronodiagramma.

23.12 Tmhma 3 - ISO/ANSI SQL Call Level Interface

To SQL/CLI einai ena programmatistiko interface epipedoy klhsewn gia SQL baseis. Exei sxediastei gia na yposthrizei prosbash se baseis apo shrink-wrapped efarmoges. To CLI dhmioyrgh8hke arxika apo mia ypoepitroph toy SQL Access Group (SAG). Oi prodiagrafes toy SAG/CLI ekdo8hkan san tis prodiagrafes toy Microsoft Open DataBase Connectivity (ODBC) to 1992. To 1993, to SAG esteile to CLI stis epitropes ANSI kai ISO SQL. (To gkroyp SQL Access exei sygxwney8ei twra me to X/Open consortium.) To SQL/CLI parexei ena die8nes protypo gia :

• CLI anejarthto ylopoihshs, gia prosbash se baseis SQL

• Client-Server ergaleia poy mporoun na exoyn prosbash se mia bash mesw dynamikwn biblio8hkwn • Yposthrijh kai en8arrynsh plousioy synoloy ergaleiwn Client-server

SQL/CLI Timing Sta plaisia ths diadikasia typopoihshs, to SQL/CLI epejergazetai me megalh proteraiothta.

• To SQL/CLI einai ena symplhrwma toy protupoy 1992 SQL (SQL-92)

• Oloklhrw8hke san protypo ISO to 1995

• ISO/IEC 9075-3:1995 Information technology – Database languages – SQL – Part 3: Call-Level Interface (SQL/CLI)

• H trexoysa SQL/CLI prospa8eia poy ginetai einai na proste8ei yposthrijh gia xarakthristika ths SQL3

23.13 Tmhma 4 - ISO/ANSI SQL Persistent Stored Modules

To SQL/PSM epekteinei thn SQL pros8etontas:

• Dhlwtikes/Diadikastikes epektaseis

• Multi-statement kai Stored Procedures

• Ejwterikes synarthseis kai klhseis diadikasiwn

Ektos toy oti einai ena ajiologo ergaleio anaptyjhs efarmogwn, to SQL/PSM parexei th 8emeliwdh yposthrijh gia antikeimenostrafeis dynatothtes sthn SQL3. Multi-statement kai Stored Procedures Oi Multi-statement kai stored procedures prosferoyn mia poikilia pleonekthmatwn se ena periballon client/server:

• Apodosh- Mia kai mia stored procedure mporei na ektelesei pollaples SQL entoles, meiwnetai h allhlepidrash me ton pelath (client).

• Asfaleia - Enas xrhsths mporei na apokthsei to dikaiwma na kalei mia stored procedure poy enhmerwnei ena pinaka h ena sunolo pinakwn alla mhn exei to dikaiwma ths apey8eias enhmerwshs twn pinakwn

• Epanaxrhsimopoihsimos kwdikas - O kwdikas se mia stored procedure de xreiazetai na janagraftei kai na janaelegx8ei gia ka8e client ergaleio poy exei prosbash sth bash.

• Elegxos - Parexei ena mono shmeio orismou kai elegxoy ths logikhs ths efarmoghs.

Dhlwtikes/Diadikastikes epektaseis H Diadikastikh Glwssa pros8etei thn isxu mias paradosiakhs glwssas programmatismou sthn SQL mesw entolwn elegxoy rohs kai mia poikilia allwn programmatistikwn kataskeywn. Entoles Elegxoy rohs

• If-then-else

• Looping constructs

• Exception handling

• Case statement

• Begin-End blocks

Oi diadikastikes epektaseis perilambanoyn kai alles programmatistikes kataskeyes:

• Dhlwseis metablhtwn

• Entoles Set gia ana8esh timwn

• Lhch diagnwstikwn gia tis diergasies kai plhrofories katastashs

Epipleon, oles oi paradosiakes SQL entoles mporoun na symperilhf8oun se diadikasies multi-statement. Klhseis Ejwterikwn Diadikasiwn kai Synarthsewn Ena xarakthristiko poy anaferetai syxna stis eyxethries listes toy ti 8a epi8ymousame gia polla proionta basewn, kai poy exei ylopoih8ei se merikes, einai h dynatothta na employtismou twn enswmatwmenwn xarakthristikwn me klhseis se diadikasies poy exei gracei o xrhsths ejwterika ektos ths bashs.

• Epitrepei se ena sygkekrimeno site h efarmogh na pros8esei tis dikes toy synarthseis gia th bash

• Mporei na xrhsimopoih8ei apo tis efarmoges baseis dedomenwn

To pleonekthma ayths ths dynatothtas einai oti dinei sth bash (synepws kai stis efarmoges basewn) prosbash se terastio ari8mo diadikasiwn kai synarthsewn. Xronismos toy SQL/PSM To SQL/PSM exei en syntomia:

• To SQL/PSM einai mia pros8hkh sto SQL-92

• Die8nhs chfoforia gia thn proodo toy SQL/PSM apo to Draft Die8nes Protypo sto Die8nes Protypo oloklhrw8hke ton Ianoyario toy 1996.

• H dior8wtikh synedriash to Maio toy 1996 den epelyse ola ta sxolia

• H synexish ths dior8wtikhs synedriashs PSM programmatisthke apo tis 30 Septembrioy mexri tis 4 Oktwbrioy toy 1996

• To xronodiagramma einai piestiko alla yparxei mia pi8anothta na ekdo8ei to PSM mesa sto 1996.

• O epishmos prosdiorismos 8a einai: ISO/IEC DIS 9075-4:199? Information technology – Database languages – SQL – Part 4: SQL Persistent Stored Modules (SQL/PSM)

• Exei hdh jekinhsei doyleia gia thn pros8hkh yposthrijhs SQL/PSM sta xarakthristika ths SQL3.

23.14 Tmhma 5 - Typopoihseis - Desmeuseis ISO/ANSI SQL/ ISO/ANSI SQL/Bindings

Gia eykolia anaforwn, oi desmeuseis, typopoihseis ths glwssas programmatismou exoyn sygkentrw8ei se ena jexwristo keimeno. H trexoysa ekdosh einai apla ena apospasma apo ta protypa ths SQL-92(dynamika (dynamic) kai enswmatoumena (embedded)).

Paramenei adieykrinisth mia poikilia 8ematwn typopoihshs ths glwssas.

Sthn paradosiakh programmatistikh glwssa, yparxoyn oi apeikoniseis twn tupwn dedomenwn ths SQL-92. Parola ayta, 8a prepei na oristoun kai oi apeikoniseis metaju twn antikeimenwn ths SQL kai twn metablhtwn ths programmatistikhs glwssas..

Gia tis antikeimenostrafeis glwsses, prepei na oristei h apeikonish gia toys tupoys dedomenwn ths SQL kai metaju toy monteloy antikeimenwn ths SQL kai toy monteloy antikeimenwn ths antikeimenostrafous glwssas.

To montelo dedomenwn 8a prepei na oristikopoih8ei prin arxisei na ginetai anafora se tetoioy tupoy problhmata.

Oi typopoihseis ths glwssas 8a oloklhrw8oun ws meroys toy protypoy SQL3.

23.15 Tmhma 6 - ISO/ANSI SQL XA Interface Specialization (SQL/XA)

Oi prodiagrafes aytes 8a typopoihsoyn ena programmatistiko interface (API) metaju enos genikou Diaxeiristh Syndiallagwn (Transaction Manager) kai enos Diaxeiristh Porwn (Resource Manager) SQL. 8a typopoihsei tis klhseis synarthsewn, basizomenos sta protypa toy ISO/IEC 10026, ”Distributed Transaction Processing”, poy enas Diaxeirisths Porwn SQL 8a prepei na yposthrizei, gia na kanei commit duo stadiwn (two-phase commit) To basiko keimeno anaforas ejagetai apo mia dhmosieysh toy X/Open, me thn adeia toy X/Open, poy prosdiorizei rhta tis parametroys eisodoy kai ejodoy kai thn shmeiografia (semantics), gia tis akoloy8es synarthseis: xa close, xa commit, xa complete, xa end, xa forget,xa open, xa prepare, xa recover, xa rollback, kai xa start.

O ISO epixeirei na epitaxunei tis prodiagrafes toy X/Open XA. H diadikasia epitaxynshs yio8etei biomhxanikes prodiagrafes xwris allages. H chfoforia gia to XA sto ISO SC21, JTC epipedo 1, arxise stis 27 Aprilioy, 1995 kai teleiwse stis 27 Oktwbrioy, 1995. An to 75 twn chfoforwn egkrinoyn tis prodiagrafes toy XA, kai apo ta 2/3 twn p-melwn toy JTC 1, 8a apotelesei ena Die8nes Protypo. An h chfoforia to egkrinei, to SQL/XA 8a mporouse na ginei ena protypo mesa sto 1996.

23.16 Part 7 - ISO/ANSI SQL Temporal

H Temporal SQL asxoleitai me xronika ejartwmena dedomena. H idea einai pws einai xrhsimo na analuoyme ta dedomena gia na doume pws emoiazan kapoia dedomenh xronikh stigmh. H Temporal SQL einai ena paper toy Dekembrioy toy 1994 apo ton Rick Snodgrass poy perigrafei aytes tis ennoies.

H X3 anakoinwnei thn egkrish enos Neoy Ergoy, ISO/IEC 9075 Meros 7o: H SQL/Temporal einai mia dhmosieysh tupoy sxetikh me thn SQL/Temporal.

     ----------------------------------------------------------------------------
                                     Temporal SQL
                                     ************
     Rick Snodgrass (proedros ths epitrophs TSQL2)
     31-Dek-1994

Arketoi amfisbhthsan thn anagkh ayjhmenhs yposthrijhs xronoy sthn SQL3 (opws ayto proteinetai apo to DBL RIO-75, opoy kai zhta ena neo tmhma ths SQL poy na yposthrizei xronikes (temporal) baseis). O isxyrismos toys basizetai sto oti oi afhrhmenoi tupoi dedomenwn (abstract data types -ADT’s) arkoun gia xronikh yposthrijh. Se ayto to plhroforiako keimeno, diafwnw, kai, xrhsimopoiwntas adiaseista paradeigmata, deixnw pws xrhsimopoiwntas mono sthles me afhrhmenoys tupoys dedomenwn den arkei gia xronikes erwthseis. Eidikotera, polles koines xronikes erwthseis, einai eite duskoles na prosomoiw8oun me SQL, eite apaitoun thn enswmatwsh SQL se mia diadikastikh (procedural) glwssa. Oi enallaktikes luseis ekfrazontai se TSQL2, mia xronikh epektash sthn SQL-92.

23.16.1 EISAGWGH

H yposthrijh egkyroy xronoy (Valid-time) jepernaei ayth enos koinou xronikou afhrhmenoy tupoy dedomenwn (ADT). Ston teleytaio, mia sthlh prosdiorizetai san ena xroniko pedio, eite ws DATE eite ws INTERVAL (8a do8oun paradeigmata suntoma). Me ton egkyro xrono, oi grammes enos pinaka diaforopoiountai me to perasma toy xronoy, ka8ws diaforopoieitai kai h pragmatikothta. H xronikh sfragida (timestamp) poy sxetizetai me mia grammh enos pinaka egkyrwn xronwn (valid-time table) metafrazetai apo thn glwssa erwthsewn ws h xronikh stigmh gia thn opoia o syndyasmos timwn twn sthlwn ths grammhs ekeinhs htan egkyros. H uparjh ths emmeshs ayths xronikhs sfragidas epitrepei thn diatupwsh safwn kai prwtotypwn erwthsewn.

23.16.2 MIA MELETH- APO8HKEYSH SYGXRONWN/TREXOYSWN PLHROFORIWN

To Grafeio Proswpikou toy Panepisthmioy ths Arizona exei kapoies plhrofories se mia bash dedomenwn, mesa stis opoies kai to onoma twn ypallhlwn, ton trexonta mis8o toys, kai ton trexoysa 8esh toys. Ayto mporei na perigrafei me enan aplo pinaka.

             Employee(Name, Salary, Title)

Dedomenoy aytou toy pinaka, h euresh toy mis8ou enos ypallhloy einai eukolh.

             SELECT Salary
             FROM Employee
             WHERE Name = 'Bob'

Twra to Grafeio Proswpikou epi8ymei na katagrafei kai thn hmeromhnia gennhshs. Gia na to kanei, pros8etei mia sthlh ston pinaka, kai etsi prokuptei to akoloy8o sxhma.

             Employee(Name, Salary, Title, DateofBirth DATE)

H euresh twn gene8liwn enos ypallhloy einai analogh me to na broume to mis8o toy.

             SELECT DateofBirth
             FROM Employee
             WHERE Name = 'Bob'

23.16.3 MELETH - APO8HKEYSH ISTORIKWN PLHROFORIWN

To Grafeio Proswpikou epi8ymei perasei ta istorika stoixeia twn ypallhlwn se hlektronikh morfh. Gia na to kanei, pros8etoyn duo sthles, mia poy ypodeiknuei pote egine egkyrh h plhroforia ths grammhs, kai mia gia to pote epace na isxuei.

Employee (Name, Salary, Title, DateofBirth, Start DATE, Stop DATE)

Sto montelo dedomenwn, aytes oi duo sthles einai paromoies me to DateofBirth. Parola ayta, h paroysia toys exei epiptwseis megalhs klimakas.

23.16.4 MELETH - PROBOLH (PROJECTION)

Gia na broume ton trexonta mis8o enos ypallhloy, ta pragmata einai pleon dyskolotera.

             SELECT Salary
             FROM Employee
             WHERE Name = 'Bob' kai Start <= CURRENT_DATE kai CURRENT_DATE <= Stop

Ayth h erwthsh einai pio sun8eth apo oti h prohgoumenh. H dyskolia einai profanws oi duo nees sthles. To Grafeio Proswpikou 8elei na dianemei se ka8e ypallhlo to mis8ologiko toy arxeio. Eidikotera, gia ka8e enan, 8a prepei na ka8oristoun ta megista diasthmata ana mis8o. Dystyxws, ayto den einai dynato me SQL. Enas ypallhlos exei ena tyxaio ari8mo allagwn 8esewn metaju mis8ologikwn allagwn.

     Name    Salary  Title             DateofBirth   Start           Stop
     ----    ------  -----             -----------   -----           ----
     Bob     60000   Assistant Provost 1945-04-09    1993-01-01      1993-05-30
     Bob     70000   Assistant Provost 1945-04-09    1993-06-01      1993-09-30
     Bob     70000   Provost           1945-04-09    1993-10-01      1994-01-31
     Bob     70000   Professor         1945-04-09    1994-02-01      1994-12-31
                                    Eikona 1

Shmeiwste pws yparxoyn treis grammes opoy o mis8os toy Bob paremeine sta8eros stis $70,000. Gi ayto to apotelesma 8a eprepe na dwsei duo grammes gia ton Bob.

     Name    Salary  Start           Stop
     ----    ------  -----           ----
     Bob     60000   1993-01-01      1993-05-30
     Bob     70000   1993-06-01      1994-12-31

Mia enallaktikh lush einai na do8ei ston xrhsth mia ektupwsh plhroforiwn Mis8ou kai Titloy, kai na afhnoyme ton xrhsth na ka8orizei pote allaje o mis8os toy. H enallaktikh ayth den einai polu 8elktikh h realistikh. Mia deuterh, einai na xrhsimopoihsoyme oso pio polu SQL ginetai.

     CREATE TABLE Temp(Salary, Start, Stop)
     AS      SELECT Salary, Start, Stop
             FROM Employee;

epanalabate

             UPDATE Temp T1
             SET (T1.Stop) = (SELECT MAX(T2.Stop)
                              FROM Temp AS T2

                              WHERE T1.Salary = T2.Salary kai T1.Start < T2.Start
                                     kai T1.Stop >= T2.Start kai T1.Stop < T2.Stop)
             WHERE EXISTS (SELECT *
                           FROM Temp AS T2
                           WHERE T1.Salary = T2.Salary kai T1.Start < T2.Start
                                     kai T1.Stop >= T2.Start kai T1.Stop < T2.Stop)
             mexri na mhn enhmerw8ei kamia grammh;
     DELETE FROM Temp T1
     WHERE EXISTS (SELECT *
                   FROM Temp AS T2
                   WHERE T1.Salary = T2.Salary
                             kai ((T1.Start > T2.Start kai T1.Stop <= T2.Stop)
                             OR (T1.Start >= T2.Start kai T1.Stop < T2.Stop))

O brogxos briskei ta diasthmata ekeina poy epikaluptontai h einai geitonika kai gi ayto 8a eprepe na sygxwney8oun. O broxos ekteleitai N fores sthn xeiroterh periptwsh, opoy to N einai o ari8mos twn grammwn se mia alysida epikalyptomenwn h geitonikwn grammwn me ises times. O anagnwsths mporei na prosomoiwsei thn erwthsh toy pinaka toy paradeigmatos gia na peistei gia thn or8othta toy parapanw.

Mia trith enallaktikh einai na xrhsimopoihsoyme SQL mono gia na anoijoyme ena kersora (cursor) ston pinaka. Mia syndedemenh lista xronikwn periodwn 8a krath8ei, ka8e mia exontas kai ena mis8o. H syndedemenh lista arxikopoieitai kenh.

     DECLARE emp_cursor CURSOR FOR
             SELECT Salary, Title, Start, Stop
             FROM Employee;
     OPEN emp_cursor;
     loop:
             FETCH emp_cursor INTO :salary, :start, :stop;
             if no-data returned then goto finished;
             find position in linked list to insert this information;
             goto loop;
     finished:
     CLOSE emp_cursor;

dietreje th lista typwnontas hmeromhnies kai mis8ous

H syndedemenh lista mporei kai na mhn xreiazetai sthn periptwsh ayth ana o kersoras einai ORDER BY Start.

Se ka8e periptwsh, h erwthsh, poy einai kai fysikh, einai duskolo na ekfrastei me tis yparxoyses dynatothtes ths SQL-92. H erwthsh einai tetrimmenh se TSQL2.

             SELECT Salary
             FROM Employee

23.16.5 MELETH - SYSXETISMOS (JOIN)

Mia pio drastikh proseggish einai na apofugoyme to problhma ths ejagwghs ths mis8ologikhs istorias me anadiorganwsh toy sxhmatos wste na aposyzeujoyme to mis8o, th 8esh kai thn hmeromhnia gennhshs (parakatw, agnooume thn hmeromhnia gennhshs, gia aplothta).

             Employee1 (Name, Salary, Start DATE, Stop DATE)
             Employee2 (Name, Title, Start DATE, Stop DATE)

O pinakas Employee1 exei ws akolou8ws.

Name    Salary  Start           Stop
----    ------  -----           ----
Bob     60000   1993-01-01      1993-05-30
Bob     70000   1993-06-01      1993-12-31

Edw einai kai o pinakas Employee2 toy paradeigmatos.

Name    Title                   Start           Stop
----    ------                  -----           ----
Bob     Assistant Provost       1993-01-01      1993-09-30
Bob     Provost                 1993-10-01      1994-01-31
Bob     Professor               1994-02-01      1994-12-31

Me ayth thn allagh, h apokthsh ths plhroforias toy mis8ou gia enan ypallhlo einai pleon eukolh.

        SELECT Salary, Start, Stop
        FROM Employee1
        WHERE Name = 'Bob'

Alla ti 8a ginei ean to Grafeio Proswpikou 8elhsei enan pinaka mis8ou, diasthmatwn 8eshs (dhladh, as ypo8esoyme pws to G.P. 8elei enan pinaka ths morfhs ths Eikonas 1); Mia enallaktikh lush einai na typwsoyme toys duo pinakes kai na afhsoyme ton xrhsth na ypologisei toys syndyasmous. Mia deuterh enallaktikh, einai na xrhsimopoihsoyme mono SQL. Dystyxws, h erwthsh ayth prepei na kanei mia analysh katastasewn toy pws mia grammh toy Employee1 epikaluptei grammes toy Employee2. Yparxoyn tesseris dynates katastaseis.

SELECT Employee1.Name, Salary, Dept, Employee1.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     and Employee2.Start <= Employee1.Start and Employee1.Stop < Employee2.Stop
UNION
SELECT Employee1.Name, Salary, Dept, Employee1.Start, Employee2.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     and Employee1.Start >= Employee2.Start and Employee2.Stop < Employee1.Stop
        kai Employee1.Start < Employee2.Stop
UNION
SELECT Employee1.Name, Salary, Dept, Employee2.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     and Employee2.Start > Employee1.Start and Employee1.Stop < Employee2.Stop
        and Employee2.Start < Employee1.Stop
UNION
SELECT Employee1.Name, Salary, Dept, Employee2.Start, Employee2.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     and Employee2.Start > Employee1.Start and Employee2.Stop < Employee1.Stop

To na piasoyme tis tesseris katastaseis einai mia duskolh kai endiaferoysa ergasia. Se TSQL2, to na kanoyme ena xroniko sysxetismo (temporal join) einai opws kapoios 8a perimene.

        SELECT Employee1.Name, Salary, Dept
        FROM Employee1, Employee2
        WHERE Employee1.Name = Employee2.Name

23.16.6 MELETH - A8ROISTIKOI TELESTES (AGGREGATES)

Twra to G.P. erwtatai, poios einai o megistos mis8os; Prin thn eisagwgh toy xronoy, ayto htan eukolo.

             SELECT MAX(Salary)
             FROM Employee

Twra omws poy h mis8ologikh istoria apo8hkeuetai, 8a 8elame mia istoria toy megistoy mis8ou ana ton xrono. To problhma fysika einai, pws h SQL den parexei xronikous a8roistikous telestes. O eukolos tropos na ginei to parapanw, einai na typwsoyme thn plhroforia kai na thn diatrejoyme xeirokinhta gia ta megista. Enallaktika, 8a mporousame na kanoyme texnasmata kai na metatrecoyme thn a8roistikh erwthsh se mia mia mh a8roistikh, kai meta ayth se xronikh. H mh a8roistikh 8a ebriske ekeinoys toys mis8ous gia toys opoioys den yparxei megaluteros mis8os.

             SELECT Salary
             FROM Employee AS E1
             WHERE NOT EXISTS (SELECT *
                               FROM Employee AS E2
                               WHERE E2.Salary > E1.Salary)

H metatroph mias tetoias erwthshs apexei polu apo to na 8ewrh8ei tetrimmenh. To akoloy8o einai mia proseggish.

     CREATE TABLE Temp (Salary, Start, Stop)
     AS      SELECT Salary, Start, Stop
             FROM Employee;
     INSERT INTO Temp
             SELECT T.Salary, T.Start, E.Start
             FROM Temp AS T, Employee AS E
             WHERE E.Start >= T.Start and E.Start < T.Stop and E.Salary > T.Salary;
     INSERT INTO Temp
             SELECT T.Salary, T.Stop, E.Stop
             FROM Temp AS T, Employee AS E
             WHERE E.Stop > T.Start and E.Stop <= T.Stop and E.Salary > T.Salary;
     DELETE FROM Temp T
     WHERE EXISTS (SELECT *
                   FROM Employee AS E
                   WHERE ((T.Start => E.Start and T.Start < E.Stop)
                             OR (E.Start >= T.Start and E.Start < T.Stop))
                         kai E.Salary > T.Salary;

Ayth h proseggish dhmioyrgei enan boh8htiko pinaka. Pros8etoyme se ayton ton pinaka thn xamhloterh periodo apo mia afairesh diasthmatwn kai thn megaluterh periodo apo mia afairesh diasthmatwn. Meta diagrafoyme oles tis periodoys poy epikaluptontai me kapoia grammh poy orizetai apo thn ypo-erwthsh (subquery), kai menoyn oi NOT EXISTS. Telika, dhmioyrgoume apo ton boh8htiko pinaka ta megista diasthmata, me ton idio tropo poy ypologisthke parapanw h plhroforia mis8wn. Opws mporoume na fantastoume, tetoios kwdikas SQL einai yperbolika anapotelesmatikos gia na ektelestei, dedomenoy twn sun8etwn fwliasmenwn (nested) ypoerwthsewn me toys telestes sugkrishs me krithria anisothtas.

Mia trith enallaktikh lush, einai na xrhsimopoihsoyme SQL oso ligotero ginetai, kai na ypologisoyme thn epi8ymhth istorikothta apo megistes times se mia allh glwssa xrhsimopoiwntas enswmatwmenoys kersores.

H erwthsh se TSQL2 einai aploustath.

             SELECT MAX(Salary)
             FROM Employee

23.16.7 PERILHYH

Oi perissoteres efarmoges me bash dedomenwn exoyn na antimetwpisoyn kai dedomena me xronikh diakumansh einai anagkh na antimetwpistoun . H yposthrijh egkyroy-xronoy einai apousa sthn SQL. Polles koines xronikes erwthseis einai loipon eite duskoles na ejomoiw8oun mesw SQL, h apaitoun enswmatwsh ths SQL se mia dhlwtikh / diadikastikh glwssa (procedural), logw ths elleichs yposthrijhs pinakwn egkyroy-xronoy sto montelo dedomenwn kai sthn kataskeyh erwthsewn ths SQL.

Se allo shmeio, deijame pws h yposthrijh egkyroy-xronoy apaitei mikres allages sthn ylopoihsh ths DBMS, kai mporei na aplopoihsei dramatika kapoies erwthseis, na kanei dynates alles, kai akolou8ws na epitrecei me8odoys deiktodothshs kai strathgikes beltistopoihsewn poy mporoun na odhghsoyn se shmantikes kalytereuseis apodoshs.

Me to neo tmhma ths SQL3 poy yposthrizei plhrofories me xronikh diakumansh, mporoume na arxisoyme na stoxeuoyme se tetoies efarmoges, epitrepontas sthn SQL3 na diaxeirizetai kalutera ta xronika dedomena.

     ----------------------------------------------------------------------------
                Epitroph Epikurwshs Protupwn* X3, Texnologia Plhroforiwn
     DHMOSIEYSH NEWN
     Ar. Eggrafoy:       PR/96-0002
     Apanthsh eis:       Barbara Bennett sto bbennett@itic.nw.dc.us
                 H X3 anakoinwnei thn Egkrish enos Neoy Ergoy, ISO/IEC
                              9075 Tmhma 7:  SQL/Temporal
     Washington D.C., Ianoyarios 1996
     ----------------------------------------------------------------------------

– Epitroph Epikurwshs Protupwn X3, Texnologia Plhroforiwn anakoinwnei thn egkrish enos Neoy Ergoy sthn xronikh yposthrijh SQL (SQL/Temporal), ISO/IEC 9075 Tmhma 7. O skopos toy proteinomenoy protupoy prosdiorizei ena neo Tmhma sto anerxomeno protypo SQL3, p.x., to Tmhma 7, Xronikh SQL, ws epektaseis ths glwssas SQL poy yposthrizoyn thn anakthsh , kai epejergasia xronikwn dedomenwn se ena periballon mias SQL bashs dedomenwn. H epomenh synedria X3H2 programmatisthke gia tis 11-14 Martioy toy 1996 sto Kansas.

Erwthseis gia to ergo ayto 8a prepei na staloun sto

             Chairman of X3H2,
             Dr. Donald R. Deutsch,
             Sybase, Inc., Suite 800,
             6550 Rock Spring
             Drive, Bethesda, MD  20817.
             Email: deutsch@sybase.com.

Mia arxikh prosklhsh gia patentes kai sxetika 8emata (pneymatikes idiokthsies, emporika shmata) (copyrights, trademarks) ekdidetai ayton ton kairo. Ypobalete plhrofories gia ta 8emata ayta sto

             X3 Secretariat at

             1250 Eye Street
             NW, Suite 200,
             Washington DC  20005.
             Email: x3sec@itic.nw.dc.us
             FAX:  (202)638-4922.

23.17 Tmhma 8 - ISO/ANSI POLYMESA SQL (SQL MULTIMEDIA - SQL/MM)

Ena neo die8nes ergo typopoihshs ISO/IEC gia thn anaptyjh mias biblio8hkhs klasewn SQL (SQL class library) gia efarmoges polymeswn egkri8hke apo tis arxes toy 1993. Ayth h nea drasthriothta typopoihshs, onomazomenh SQL Multimedia (SQL/MM), 8a ka8orisei paketa me orismous afhrhmenwn tupwn dedomenwn SQL (abstract data type- ADT) xrhsimopoiwntas tis eykolies gia ton ka8orismo toy ADT kai thn proklhsh poy parexetai stis anamenomenes prodiagrafes toy SQL3. To SQL/MM exei san stoxo na typopoihsei tis biblio8hkes klasewn gia thn episthmh kai mhxanikh, thn full-text epejergasia keimenoy, kai tis me8odoys gia diaxeirish antikeimenwn polymeswn opws eikona, hxos, animation, moysikh, kai binteo. 8a parexei pi8ana ena SQL language binding antikeimeno polymeswn apo alles JTC1 organwseis protypopoihshs (p.x. SC18 gia keimena, SC24 gia eikones, kai SC29 gia fwtografies kai kinoumenes eikones).

To plano aytou toy ergoy gia to SQL/MM deixnei oti 8a einai ena spondylwto protypo poy 8a apoteleitai apo ena ayjanomeno ari8mo tmhmatwn. To tmhma 1 8a einai ena Plaisio (Framework) poy 8a prosdiorizei pws 8a kataskeyastoun ta ypoloipa merh. Ka8e ena apo ta ypoloipa merh, 8a einai afosiwmeno se ena sygkekrimeno paketo SQL efarmogwn. H parakatw domh tmhmatwn toy SQL/MM yparxei apo ton Augoysto toy 1994:

• Tmhma 1: Plaisio. Mh texnikh perigrafh toy pws domeitai to keimeno.

• Tmhma 2: Me8odoi Keimenoy kai ADTs gia epejergasia dedomenwn keimenoy. Peri tis 45 selides.

• Tmhma 3: Xwrikes Me8odoi kai ADTs gia diaxeirish xwrikwn dedomenwn. Peri tis 200 selides me syneisfores apo eidikous sta xwrika dedomena, apo organwseis 3 xwrwn.

• Tmhma 4: Me8odoys Genikou Skopou kai ADTs gia migadikous ari8mous. Oi dynatothtes perilambanoyn trigwnometrikes kai ek8etikes synarthseis, dianusmata, sunola, klp. Pros to paron peri tis 90 selides.

yparxei ena plh8os stantar ergasiwn ston tomea ton Xwrikwn kai Gewgrafikwn Systhmatwn:

• ANSI X3L1 - Geographic Information Systems. Mark Ashworth of Unisys is the liason between X3L1 kai ANSI X3H2. He is also the editor for parts 1, 3, kai 4 of the SQL/MM draft.

• ISO TC 211 - Geographic information/Geomatics

24 Texnikh yposthrijh gia thn PostgreSQL

An exete opoiadhpote texnikh erwthsh h synanthsete opoiodhpote problhma mporeite na steilete e-mail sto:

   • pgsql-questions@postgresql.org

kai na perimenete apanthsh me e-mail se ligotero apo mia mera. Ka8ws h bash twn xrhstwn sto internet einai terastia, kai oi xrhstes yposthrizoyn toys alloys xrhstes, to internet 8a einai ikano na dwsei eukola texnikh yposthrijh se disekatommuria xrhstes. H yposthrijh me Email einai polu pio bolikh apo thn thlefwnikh yposthrijh ka8ws mporeite na kanete cut kai paste ta mhnumata la8wn, thn ejodo toy programmatos klp. kai na to metadwsete eukola sth lista allhlografias/newsgroup.

Sto prosexes mellon, o organismos ths PostgreSQL 8a poyla texnikh yposthrijh se megales/mikres etaireies, ta esoda poy 8a prokucoyn 8a xrhsimopoih8oun gia th synthrhsh arketwn mirror sites (web kai ftp) se olo ton kosmo. 8a xrhsimopoih8oun epishs gia thn paragwgh ektypwmenhs tekmhriwshs, boh8hmatwn, bibliwn poy 8a boh8hsoyn toys pelates.

Mporeite epishs na boh8h8eite apo symboyleytikes etaireies opws h Anderson, WGS (Work Group Solutions). Epikoinwnhste mazi toys gia boh8eia -

   • Work Group Solutions <http://www.wgs.com>
   • Anderson Consulting <http://www.ac.com>

25 Oikonomika kai Epaggelmatika 8emata

Oi emporikes baseis plhrwnoyn pollous foroys, endeiktika anaferoyme : omospondiakous, politeiakous, pwlhsewn, ergasiakous, koinwnikhs asfaleias, iatrikhs peri8alchs ergazomenwn, 8elghtrwn gia toys ergazomenoys, kosth gia marketing kai diafhmish. Ola ayta ta ejoda den phgainoyn katey8eian gia thn anaptyjh ths bashs. Otan agorazete mia emporikh bash, meros ths timhs phgainei gia epibarunseis opws foroi, ejoda kai to isozugio toy kostoys ths bashs R&D.

Oi emporikes baseis, epishs, prepei na plhrwsoyn gia ktiria/ktismata kai na agorasoyn mhxanes Unix, na tis egkatasthsoyn kai na tis synthrhsoyn. Ola ayta ta ejoda epibarunoyn telika ton pelath.

H PostgreSQL yperexei enanti twn emporikwn basewn mia kai den plhrwnoyn amesa foroys ka8ws anaptussetai mesw internet. Ena terastio plh8os an8rwpwn syneisferei sthn anaptyjh ths PostgreSQL. Gia paradeigma, se mia ypo8etikh periptwsh, an yparxoyn ena ekatommurio etaireies sthn Amerikh kai ka8e mia syneisferei 10 $ (ajia toy logismikou PostgreSQL) tote ka8e mia 8a labei deka ekatommuria dolaria!! Ayth einai h MAGEIA ths anaptyjhs logismikou sto internet.

Mexri twra, o phgaios kwdikas ths PostgreSQL einai peripoy 2,00,000 grammes se kwdika ”C”, ”C++”. An to kostos ka8e grammhs kwdika ”C” einai $ 2 tote to synoliko kostos ths PostgreSQL 8a htan shmera $ 4,00,000 (tetrakosies xiliades dolaria!).

Polles etaireies hdh anaptussoyn terasties posothtes kwdika ”C”, ”C++”. Etsi, to na paroyn ton phgaio kwdika ths PostgreSQL kai na synergastoun me alles etaireies sto internet 8a wfelhsei thn etaireia na ejoikonomhsei xrono kai prospa8eia.

26 Lista allwn basewn dedomenwn

Parakatw akoloy8ei lista allwn SQL basewn dedomenwn gia Unix, Linux.

• Pathste kai phgainete sto Applications->databases. <http://www.caldera.com/tech-ref/

     linuxapps/linapps.html>

• Pathste kai phgainete sto Applications->databases. <http://www.xnet.com/~blatura/linapps.

     shtml>

• Phges gia Baseis Dedomenwn <http://linas.org/linux/db.html> grafthke apo ton Linas Vepstas:

     linas@fc.net
   • Lista dwrean basewn <http://cuiwww.unige.ch:80/~scg/FreeDB/FreeDB.list.html>

• Lista RDBMS toy Browne <http://www.hex.net/~cbbrowne/rdbms.html> grafthke apo ton Christo-

     pher B. Browne cbbrowne@hex.net
   • Lista Sxesiakwn DBMS toy SAL <http://SAL.KachinaTech.COM/H/1/>

• Lista Antikeimenostrafwn DBMS toy SAL <http://SAL.KachinaTech.COM/H/2/>

• Lista boh8htikwn efarmogwn kai allwn basews toy SAL <http://SAL.KachinaTech.COM/H/3/>

• ACM SIGMOD. Deikths toy dhmosia dia8esimoy logismikou Basewn Dedomenwn <http://bunny.

     cs.uiuc.edu/sigmod/databaseSoftware/>

27 Xrhsimes symboyles gia anazhthseis sto Internet World Wide Web

To Internet einai aperanto, yparxei se ayto terastia posothta logismikou kai mia 8alassa plhroforiwn apo katw toy. Ayjanetai me ry8mo 300% ethsiws se olo ton kosmo. Ypologizetai oti yparxoyn peripoy 10 ekatommuria Web sites se olh th gh!

Gia na cajete gia plhrofories 8a xrhsimopoihsete mhxanes anazhthshs opws to ”Yahoo”, ”Netscape”, ”Lycos” klp. Phgainete sto Yahoo kai pathste sto search. Xrhsimopoihste tis epiloges filtrarismatos gia na sygkekrimenopoihsete ta krithria anazhthshs. H default epilogh anazhthshs einai h ”Ejypnh anazhthsh” (”Intelligent search”) poy einai pio genikh kai emfanizei oles tis pi8anothtes. Pathste stis ”Epiloges” (”Options”) gia na dialejete anazhthsh me ”akribh frash”(”EXACT phrase”), anazhthsh me ”AND”, me ”OR”, klp. Me ayton ton tropo 8a breite tis plhrofories poy 8elete polu grhgorotera.

28 Symperasma

Meta apo ereyna se oles tis dia8esimes baseis poy einai DWREAN kai o phgaios toys kwdikas einai dia8esimos, katalhjame oti MONO h PostgreSQL einai h PERISSOTERO wrimh, PERISSOTERO eyrews diadedomenh kai isxyrh, dwrean bash RDBMS SQL (antikeimenostrafhs-sxesiakh), ston kosmo.

H PostgreSQL einai idiaitera elkystikh mia kai exei hdh ginei arketh doyleia, kai exei odhgous ODBC, JDBC me toys opoioys einai dynato na gracete efarmoges anejarthtws bashs. Oi efarmoges poy grafontai sthn PostgreSQL me xrhsh odhgwn ODBC, JDBC einai eukola metafersimes se alles baseis, opws Oracle, Sybase kai Informix. Epishs, efarmoges poy exoyn graftei se Oracle, Sybase kai Informix me xrhsh odhgwn ODBC, JDBC einai eukola metafersimes sthn PostgreSQL.

Mporei na anarwth8eite ”Alla giati PostgreSQL ;” H apanthsh einai oti mia kai xreiazetai polu perissoteros xronos gia na anaptyx8ei ena neo susthma bashs apo thn arxh, einai logiko na dialejoyme ena susthma bashs dedomenwn poy ikanopoiei tis parakatw syn8hkes -

Ena susthma bashs dedomenwn

• toy opoioy o phgaios kwdikas einai dia8esimos

• poy den exei periorismous se 8emata adeias, h kapoia prosarthmenh idiokthsia se ayto

• to opoio dianemetai mesw internet

• to opoio anaptussetai edw kai polla xronia.

• to opoio ikanopoiei mellontikes anagkes opws thn SQL 3 (SQL 98)

• to opoio exei ejeligmenes dynatothtes

kai apla symbainei na einai h ’PostgreSQL’ poy ikanopoiei oles aytes tis syn8hkes kai na einai to katallhlo logismiko gia ayth thn periptwsh.

29 Syxna Diatypwmenes Erwthseis sxetika me thn PostgreSQL

Phgainete sthn teleytaia ekdosh toy FAQ gia General, Linux kai Irix sto

   • <http://www.postgresql.org/docs/faq-english.shtml>

30 Shmeiwsh Pneymatikwn Dikaiwmatwn

Pneymatikh idiokthsia (c) 1997 toy Al Dev (Alavoor Vasudevan). Ola ta dikaiwmata exoyn katoxyrw8ei.

KAMIA EY8YNH GIA EPAKOLOY8OMENES ZHMIES. Se kamia periptwsh o syggrafeas toy keimenoy den einai ypeu8ynos gia opoiadhpote zhmia (symperilambanomenwn xwris periorismo, twn eidikwn, anapantexwn, epakoloy8wn, h ameswn/ emmeswn zhmiwn, proswpikwn blabwn, apwleia epaggelmatikwn kerdwn, diakoph ergasias, apwleia epaggelmatikwn dedomenwn, h opoiadhpote xrhmatikh apwleia) poy prokucei apo th xrhsh aytou toy keimenoy.

O syggrafeas den eggyatai thn or8othta, xrhsimothta, emporikothta toy keimenoy. Oi markes, etaireies kai ta onomata twn proiontwn poy anaferontai se ayto to keimeno einai shma katate8en twn antistoixwn idiokthtwn. Sas parapempoyme sta jexwrista shmeiwmata pneymatikhs idiokthsias twn etaireiwn kai proiontwn poy anafer8hkan se ayto to keimeno. Einai dikh sas ey8unh na diabasete kai na katalabete ta shmeiwmata pneymatikhs idiokthsias twn organismwn /etaireiwn/proiontwn /syggrafewn poy anafer8hkan se ayto to keimeno prin na xrhsimopoihsete tis antistoixes plhrofories.

A Pararthma A - Suntajh toy ANSI/ISO SQL 1992

     Ayto to arxeio periexei to dendroeidh diadromh me proteraiothta ba8oys (depth-first tree traversal) toy BNF gia th glwssa, poy oloklhrw8hke stis 27-AYG-1992 11:03:41.64.
     H sygkekrimenh ekdosh toy BNF poy perilambanetai edw einai h:  ANSI-only, SQL2-only.

     <SQL terminal character> ::=
           <SQL language character>
         | <SQL embedded language character>
     <SQL language character> ::=
           <simple Latin letter>
         | <digit>
         | <SQL special character>
     <simple Latin letter> ::=
           <simple Latin upper case letter>
         | <simple Latin lower case letter>
     <simple Latin upper case letter> ::=
               A | B | C | D | E | F | G | H | I | J | K | L | M | N | O
         | P | Q | R | S | T | U | V | W | X | Y | Z

A. Pararthma A - Suntajh toy ANSI/ISO SQL 1992 72

<simple Latin lower case letter> ::=
      a | b | c | d | e | f | g | h | i | j | k | l | m | n | o
| p | q | r | s | t | u | v | w | x | y | z
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<SQL special character> ::=
  <space>
| <double quote>
| <percent>
| <ampersand>
| <quote>
| <left paren>
| <right paren>
| <asterisk>
| <plus sign>
| <comma>
| <minus sign>
| <period>
| <solidus>
| <colon>
| <semicolon>
| <less than operator>
| <equals operator>
| <greater than operator>
| <question mark>
| <underscore>
| <vertical bar>
<space> ::= !! <EMPHASIS>(space character in character set in use)
<double quote> ::= "
<percent> ::= %
<ampersand> ::= &
<quote> ::= '
<left paren> ::= (
<right paren> ::= )
<asterisk> ::= *
<plus sign> ::= +
<comma> ::= ,
<minus sign> ::= -
<period> ::= .
<solidus> ::= /

<colon> ::= :
<semicolon> ::= ;
<less than operator> ::= <
<equals operator> ::= =
<greater than operator> ::= >
<question mark> ::= ?
<underscore> ::= _
<vertical bar> ::= |
<SQL embedded language character> ::=
      <left bracket>
    | <right bracket>
<left bracket> ::= [
<right bracket> ::= ]
<token> ::=
      <nondelimiter token>
    | <delimiter token>
<nondelimiter token> ::=
      <regular identifier>
    | <key word>
    | <unsigned numeric literal>
    | <national character string literal>
    | <bit string literal>
    | <hex string literal>
<regular identifier> ::= <identifier body>
<identifier body> ::=
    <identifier start> [ ( <underscore> | <identifier part> )... ]
<identifier start> ::= <EMPHASIS>(!! See the Syntax Rules)
<identifier part> ::=
      <identifier start>
    | <digit>
<key word> ::=
      <reserved word>
    | <non-reserved word>
<reserved word> ::=
      ABSOLUTE | ACTION | ADD | ALL
    | ALLOCATE | ALTER | AND

| ANY | ARE
| AS | ASC
| ASSERTION | AT
| AUTHORIZATION | AVG
| BEGIN | BETWEEN | BIT | BIT_LENGTH
| BOTH | BY
| CASCADE | CASCADED | CASE | CAST
| CATALOG
| CHAR | CHARACTER | CHAR_LENGTH
| CHARACTER_LENGTH | CHECK | CLOSE | COALESCE
| COLLATE | COLLATION
| COLUMN | COMMIT
| CONNECT
| CONNECTION | CONSTRAINT
| CONSTRAINTS | CONTINUE
| CONVERT | CORRESPONDING | COUNT | CREATE | CROSS
| CURRENT
| CURRENT_DATE | CURRENT_TIME
| CURRENT_TIMESTAMP | CURRENT_USER | CURSOR
| DATE | DAY | DEALLOCATE | DEC
| DECIMAL | DECLARE | DEFAULT | DEFERRABLE
| DEFERRED | DELETE | DESC | DESCRIBE | DESCRIPTOR
| DIAGNOSTICS
| DISCONNECT | DISTINCT | DOMAIN | DOUBLE | DROP
| ELSE | END | END-EXEC | ESCAPE
| EXCEPT | EXCEPTION
| EXEC | EXECUTE | EXISTS
| EXTERNAL | EXTRACT
| FALSE | FETCH | FIRST | FLOAT | FOR
| FOREIGN | FOUND | FROM | FULL
| GET | GLOBAL | GO | GOTO
| GRANT | GROUP
| HAVING | HOUR
| IDENTITY | IMMEDIATE | IN | INDICATOR
| INITIALLY | INNER | INPUT
| INSENSITIVE | INSERT | INT | INTEGER | INTERSECT
| INTERVAL | INTO | IS
| ISOLATION
| JOIN
| KEY
| LANGUAGE | LAST | LEADING | LEFT
| LEVEL | LIKE | LOCAL | LOWER
| MATCH | MAX | MIN | MINUTE | MODULE
| MONTH
| NAMES | NATIONAL | NATURAL | NCHAR | NEXT | NO
| NOT | NULL
| NULLIF | NUMERIC
| OCTET_LENGTH | OF
| ON | ONLY | OPEN | OPTION | OR
| ORDER | OUTER
| OUTPUT | OVERLAPS
| PAD | PARTIAL | POSITION | PRECISION | PREPARE
| PRESERVE | PRIMARY
| PRIOR | PRIVILEGES | PROCEDURE | PUBLIC
| READ | REAL | REFERENCES | RELATIVE | RESTRICT

| REVOKE | RIGHT
| ROLLBACK | ROWS
| SCHEMA | SCROLL | SECOND | SECTION
| SELECT
| SESSION | SESSION_USER | SET
| SIZE | SMALLINT | SOME | SPACE | SQL | SQLCODE
| SQLERROR | SQLSTATE
| SUBSTRING | SUM | SYSTEM_USER
| TABLE | TEMPORARY
| THEN | TIME | TIMESTAMP
| TIMEZONE_HOUR | TIMEZONE_MINUTE
| TO | TRAILING | TRANSACTION
| TRANSLATE | TRANSLATION | TRIM | TRUE
| UNION | UNIQUE | UNKNOWN | UPDATE | UPPER | USAGE
| USER | USING
| VALUE | VALUES | VARCHAR | VARYING | VIEW
| WHEN | WHENEVER | WHERE | WITH | WORK | WRITE
| YEAR
| ZONE
<non-reserved word> ::=
  ADA
| C | CATALOG_NAME
| CHARACTER_SET_CATALOG | CHARACTER_SET_NAME
| CHARACTER_SET_SCHEMA | CLASS_ORIGIN | COBOL | COLLATION_CATALOG
| COLLATION_NAME | COLLATION_SCHEMA | COLUMN_NAME | COMMAND_FUNCTION
| COMMITTED
| CONDITION_NUMBER | CONNECTION_NAME | CONSTRAINT_CATALOG | CONSTRAINT_NAME
| CONSTRAINT_SCHEMA | CURSOR_NAME
| DATA | DATETIME_INTERVAL_CODE
| DATETIME_INTERVAL_PRECISION | DYNAMIC_FUNCTION
| FORTRAN
| LENGTH
| MESSAGE_LENGTH | MESSAGE_OCTET_LENGTH | MESSAGE_TEXT | MORE | MUMPS
| NAME | NULLABLE | NUMBER
| PASCAL | PLI
| REPEATABLE | RETURNED_LENGTH | RETURNED_OCTET_LENGTH | RETURNED_SQLSTATE
| ROW_COUNT
| SCALE | SCHEMA_NAME | SERIALIZABLE | SERVER_NAME | SUBCLASS_ORIGIN
| TABLE_NAME | TYPE
| UNCOMMITTED | UNNAMED
<unsigned numeric literal> ::=
  <exact numeric literal>
| <approximate numeric literal>
<exact numeric literal> ::=
  <unsigned integer> [ <period> [ <unsigned integer> ] ]
| <period> <unsigned integer>
<unsigned integer> ::= <digit>...
<approximate numeric literal> ::= <mantissa> E <exponent>

<mantissa> ::= <exact numeric literal>
<exponent> ::= <signed integer>
<signed integer> ::= [ <sign> ] <unsigned integer>
<sign> ::= <plus sign> | <minus sign>
<national character string literal> ::=
    N <quote> [ <character representation>... ] <quote>
      [ ( <separator>... <quote> [ <character representation>... ] <quote> )... ]
<character representation> ::=
      <nonquote character>
    | <quote symbol>
<nonquote character> ::= !! <EMPHASIS>(See the Syntax Rules.)
<quote symbol> ::= <quote><quote>
<separator> ::= ( <comment> | <space> | <newline> )...
<comment> ::=
    <comment introducer> [ <comment character>... ] <newline>
<comment introducer> ::= <minus sign><minus sign>[<minus sign>...]
<comment character> ::=
      <nonquote character>
    | <quote>
<newline> ::= !! <EMPHASIS>(implementation-defined end-of-line indicator)
<bit string literal> ::=
    B <quote> [ <bit>... ] <quote>
      [ ( <separator>... <quote> [ <bit>... ] <quote> )... ]
<bit> ::= 0 | 1
<hex string literal> ::=
    X <quote> [ <hexit>... ] <quote>
      [ ( <separator>... <quote> [ <hexit>... ] <quote> )... ]
<hexit> ::= <digit> | A | B | C | D | E | F | a | b | c | d | e | f
<delimiter token> ::=
      <character string literal>
    | <date string>
    | <time string>
    | <timestamp string>
    | <interval string>
    | <delimited identifier>
    | <SQL special character>
    | <not equals operator>
    | <greater than or equals operator>

| <less than or equals operator>
| <concatenation operator>
| <double period>
| <left bracket>
| <right bracket>
<character string literal> ::=
[ <introducer><character set specification> ]
<quote> [ <character representation>... ] <quote>
  [ ( <separator>... <quote> [ <character representation>... ] <quote> )... ]
<introducer> ::= <underscore>
<character set specification> ::=
  <standard character repertoire name>
| <implementation-defined character repertoire name>
| <user-defined character repertoire name>
| <standard universal character form-of-use name>
| <implementation-defined universal character form-of-use name>
<standard character repertoire name> ::= <character set name>
<character set name> ::= [ <schema name> <period> ]
  <SQL language identifier>
<schema name> ::=
[ <catalog name> <period> ] <unqualified schema name>
<catalog name> ::= <identifier>
<identifier> ::=
[ <introducer><character set specification> ] <actual identifier>
<actual identifier> ::=
  <regular identifier>
| <delimited identifier>
<delimited identifier> ::=
<double quote> <delimited identifier body> <double quote>
<delimited identifier body> ::= <delimited identifier part>...
<delimited identifier part> ::=
  <nondoublequote character>
| <doublequote symbol>
<nondoublequote character> ::= <EMPHASIS>(!! See the Syntax Rules)
<doublequote symbol> ::= <double quote><double quote>
<unqualified schema name> ::= <identifier>
<SQL language identifier> ::=
<SQL language identifier start>
   [ ( <underscore> | <SQL language identifier part> )... ]

<SQL language identifier start> ::= <simple Latin letter>
<SQL language identifier part> ::=
      <simple Latin letter>
    | <digit>
<implementation-defined character repertoire name> ::=
    <character set name>
<user-defined character repertoire name> ::= <character set name>
<standard universal character form-of-use name> ::=
    <character set name>
<implementation-defined universal character form-of-use name> ::=
    <character set name>
<date string> ::=
    <quote> <date value> <quote>
<date value> ::=
    <years value> <minus sign> <months value>
        <minus sign> <days value>
<years value> ::= <datetime value>
<datetime value> ::= <unsigned integer>
<months value> ::= <datetime value>
<days value> ::= <datetime value>
<time string> ::=
    <quote> <time value> [ <time zone interval> ] <quote>
<time value> ::=
    <hours value> <colon> <minutes value> <colon> <seconds value>
<hours value> ::= <datetime value>
<minutes value> ::= <datetime value>
<seconds value> ::=
      <seconds integer value> [ <period> [ <seconds fraction> ] ]
<seconds integer value> ::= <unsigned integer>
<seconds fraction> ::= <unsigned integer>
<time zone interval> ::=
    <sign> <hours value> <colon> <minutes value>
<timestamp string> ::=
    <quote> <date value> <space> <time value>

        [ <time zone interval> ] <quote>
<interval string> ::=
    <quote> ( <year-month literal> | <day-time literal> ) <quote>
<year-month literal> ::=
      <years value>
    | [ <years value> <minus sign> ] <months value>
<day-time literal> ::=
      <day-time interval>
    | <time interval>
<day-time interval> ::=
    <days value>
      [ <space> <hours value> [ <colon> <minutes value>
        [ <colon> <seconds value> ] ] ]
<time interval> ::=
      <hours value> [ <colon> <minutes value> [ <colon> <seconds value> ] ]
    | <minutes value> [ <colon> <seconds value> ]
    | <seconds value>
<not equals operator> ::= <>
<greater than or equals operator> ::= >=
<less than or equals operator> ::= <=
<concatenation operator> ::= ||
<double period> ::= ..
<module> ::=
    <module name clause>
    <language clause>
    <module authorization clause>
    [ <temporary table declaration>... ]
    <module contents>...
<module name clause> ::=
    MODULE [ <module name> ]
      [ <module character set specification> ]
<module name> ::= <identifier>
<module character set specification> ::=
    NAMES ARE <character set specification>
<language clause> ::=
    LANGUAGE <language name>
<language name> ::=
    ADA | C | COBOL | FORTRAN | MUMPS | PASCAL | PLI

<module authorization clause> ::=
  SCHEMA <schema name>
| AUTHORIZATION <module authorization identifier>
| SCHEMA <schema name>
      AUTHORIZATION <module authorization identifier>
<module authorization identifier> ::=
<authorization identifier>
<authorization identifier> ::= <identifier>
<temporary table declaration> ::=
DECLARE LOCAL TEMPORARY TABLE
    <qualified local table name>
  <table element list>
  [ ON COMMIT ( PRESERVE | DELETE ) ROWS ]
<qualified local table name> ::=
MODULE <period> <local table name>
<local table name> ::= <qualified identifier>
<qualified identifier> ::= <identifier>
<table element list> ::=
  <left paren> <table element> [ ( <comma> <table element> )... ] <right paren>
<table element> ::=
  <column definition>
| <table constraint definition>
<column definition> ::=
<column name> ( <data type> | <domain name> )
[ <default clause> ]
[ <column constraint definition>... ]
[ <collate clause> ]
<column name> ::= <identifier>
<data type> ::=
  <character string type>
       [ CHARACTER SET <character set specification> ]
| <national character string type>
| <bit string type>
| <numeric type>
| <datetime type>
| <interval type>
<character string type> ::=
  CHARACTER [ <left paren> <length> <right paren> ]
| CHAR [ <left paren> <length> <right paren> ]
| CHARACTER VARYING <left paren> <length> <right paren>
| CHAR VARYING <left paren> <length> <right paren>
| VARCHAR <left paren> <length> <right paren>

<length> ::= <unsigned integer>
<national character string type> ::=
  NATIONAL CHARACTER [ <left paren> <length> <right paren> ]
| NATIONAL CHAR [ <left paren> <length> <right paren> ]
| NCHAR [ <left paren> <length> <right paren> ]
| NATIONAL CHARACTER VARYING <left paren> <length> <right paren>
| NATIONAL CHAR VARYING <left paren> <length> <right paren>
| NCHAR VARYING <left paren> <length> <right paren>
<bit string type> ::=
  BIT [ <left paren> <length> <right paren> ]
| BIT VARYING <left paren> <length> <right paren>
<numeric type> ::=
  <exact numeric type>
| <approximate numeric type>
<exact numeric type> ::=
  NUMERIC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| DECIMAL [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| DEC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| INTEGER
| INT
| SMALLINT
<precision> ::= <unsigned integer>
<scale> ::= <unsigned integer>
<approximate numeric type> ::=
  FLOAT [ <left paren> <precision> <right paren> ]
| REAL
| DOUBLE PRECISION
<datetime type> ::=
  DATE
| TIME [ <left paren> <time precision> <right paren> ]
      [ WITH TIME ZONE ]
| TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
      [ WITH TIME ZONE ]
<time precision> ::= <time fractional seconds precision>
<time fractional seconds precision> ::= <unsigned integer>
<timestamp precision> ::= <time fractional seconds precision>
<interval type> ::= INTERVAL <interval qualifier>
<interval qualifier> ::=
  <start field> TO <end field>
| <single datetime field>
<start field> ::=

<non-second datetime field>
    [ <left paren> <interval leading field precision> <right paren> ]
<non-second datetime field> ::= YEAR | MONTH | DAY | HOUR
| MINUTE
<interval leading field precision> ::= <unsigned integer>
<end field> ::=
  <non-second datetime field>
| SECOND [ <left paren> <interval fractional seconds precision> <right paren> ]
<interval fractional seconds precision> ::= <unsigned integer>
<single datetime field> ::=
  <non-second datetime field>
      [ <left paren> <interval leading field precision> <right paren> ]
| SECOND [ <left paren> <interval leading field precision>
      [ <comma> <interval fractional seconds precision> ] <right paren> ]
<domain name> ::= <qualified name>
<qualified name> ::=
[ <schema name> <period> ] <qualified identifier>
<default clause> ::=
  DEFAULT <default option>
<default option> ::=
  <literal>
| <datetime value function>
| USER
| CURRENT_USER
| SESSION_USER
| SYSTEM_USER
| NULL
<literal> ::=
  <signed numeric literal>
| <general literal>
<signed numeric literal> ::=
[ <sign> ] <unsigned numeric literal>
<general literal> ::=
  <character string literal>
| <national character string literal>
| <bit string literal>
| <hex string literal>
| <datetime literal>
| <interval literal>
<datetime literal> ::=
  <date literal>
| <time literal>

    | <timestamp literal>
<date literal> ::=
    DATE <date string>
<time literal> ::=
    TIME <time string>
<timestamp literal> ::=
    TIMESTAMP <timestamp string>
<interval literal> ::=
    INTERVAL [ <sign> ] <interval string> <interval qualifier>
<datetime value function> ::=
      <current date value function>
    | <current time value function>
    | <current timestamp value function>
<current date value function> ::= CURRENT_DATE
<current time value function> ::=
      CURRENT_TIME [ <left paren> <time precision> <right paren> ]
<current timestamp value function> ::=
      CURRENT_TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
<column constraint definition> ::=
    [ <constraint name definition> ]
    <column constraint>
      [ <constraint attributes> ]
<constraint name definition> ::= CONSTRAINT <constraint name>
<constraint name> ::= <qualified name>
<column constraint> ::=
      NOT NULL
    | <unique specification>
    | <references specification>
    | <check constraint definition>
<unique specification> ::=
    UNIQUE | PRIMARY KEY
<references specification> ::=
    REFERENCES <referenced table and columns>
      [ MATCH <match type> ]
      [ <referential triggered action> ]
<referenced table and columns> ::=
     <table name> [ <left paren> <reference column list> <right paren> ]
<table name> ::=
      <qualified name>

| <qualified local table name>
<reference column list> ::= <column name list>
<column name list> ::=
<column name> [ ( <comma> <column name> )... ]
<match type> ::=
  FULL
| PARTIAL
<referential triggered action> ::=
  <update rule> [ <delete rule> ]
| <delete rule> [ <update rule> ]
<update rule> ::= ON UPDATE <referential action>
<referential action> ::=
  CASCADE
| SET NULL
| SET DEFAULT
| NO ACTION
<delete rule> ::= ON DELETE <referential action>
<check constraint definition> ::=
CHECK
    <left paren> <search condition> <right paren>
<search condition> ::=
  <boolean term>
| <search condition> OR <boolean term>
<boolean term> ::=
  <boolean factor>
| <boolean term> AND <boolean factor>
<boolean factor> ::=
[ NOT ] <boolean test>
<boolean test> ::=
<boolean primary> [ IS [ NOT ]
      <truth value> ]
<boolean primary> ::=
  <predicate>
| <left paren> <search condition> <right paren>
<predicate> ::=
  <comparison predicate>
| <between predicate>
| <in predicate>
| <like predicate>
| <null predicate>
| <quantified comparison predicate>

| <exists predicate>
| <unique predicate>
| <match predicate>
| <overlaps predicate>
<comparison predicate> ::=
<row value constructor> <comp op>
    <row value constructor>
<row value constructor> ::=
   <row value constructor element>
| <left paren> <row value constructor list> <right paren>
| <row subquery>
<row value constructor element> ::=
  <value expression>
| <null specification>
| <default specification>
<value expression> ::=
  <numeric value expression>
| <string value expression>
| <datetime value expression>
| <interval value expression>
<numeric value expression> ::=
  <term>
| <numeric value expression> <plus sign> <term>
| <numeric value expression> <minus sign> <term>
<term> ::=
  <factor>
| <term> <asterisk> <factor>
| <term> <solidus> <factor>
<factor> ::=
[ <sign> ] <numeric primary>
<numeric primary> ::=
  <value expression primary>
| <numeric value function>
<value expression primary> ::=
  <unsigned value specification>
| <column reference>
| <set function specification>
| <scalar subquery>
| <case expression>
| <left paren> <value expression> <right paren>
| <cast specification>
<unsigned value specification> ::=
  <unsigned literal>
| <general value specification>

<unsigned literal> ::=
  <unsigned numeric literal>
| <general literal>
<general value specification> ::=
  <parameter specification>
| <dynamic parameter specification>
| <variable specification>
| USER
| CURRENT_USER
| SESSION_USER
| SYSTEM_USER
| VALUE
<parameter specification> ::=
<parameter name> [ <indicator parameter> ]
<parameter name> ::= <colon> <identifier>
<indicator parameter> ::=
[ INDICATOR ] <parameter name>
<dynamic parameter specification> ::= <question mark>
<variable specification> ::=
<embedded variable name> [ <indicator variable> ]
<embedded variable name> ::=
<colon><host identifier>
<host identifier> ::=
  <Ada host identifier>
| <C host identifier>
| <COBOL host identifier>
| <Fortran host identifier>
| <MUMPS host identifier>
| <Pascal host identifier>
| <PL/I host identifier>
<Ada host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
<C host identifier> ::=
!! <EMPHASIS>(See the Syntax Rules.)
<COBOL host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
<Fortran host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
<MUMPS host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
<Pascal host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
<PL/I host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
<indicator variable> ::=

    [ INDICATOR ] <embedded variable name>
<column reference> ::= [ <qualifier> <period> ] <column name>
<qualifier> ::=
      <table name>
    | <correlation name>
<correlation name> ::= <identifier>
<set function specification> ::=
      COUNT <left paren> <asterisk> <right paren>
    | <general set function>
<general set function> ::=
      <set function type>
          <left paren> [ <set quantifier> ] <value expression> <right paren>
<set function type> ::=
    AVG | MAX | MIN | SUM | COUNT
<set quantifier> ::= DISTINCT | ALL
<scalar subquery> ::= <subquery>
<subquery> ::= <left paren> <query expression> <right paren>
<query expression> ::=
      <non-join query expression>
    | <joined table>
<non-join query expression> ::=
      <non-join query term>
    | <query expression> UNION  [ ALL ]
          [ <corresponding spec> ] <query term>
    | <query expression> EXCEPT [ ALL ]
          [ <corresponding spec> ] <query term>
<non-join query term> ::=
      <non-join query primary>
    | <query term> INTERSECT [ ALL ]
          [ <corresponding spec> ] <query primary>
<non-join query primary> ::=
      <simple table>
    | <left paren> <non-join query expression> <right paren>
<simple table> ::=
      <query specification>
    | <table value constructor>
    | <explicit table>
<query specification> ::=
    SELECT [ <set quantifier> ] <select list> <table expression>

<select list> ::=
  <asterisk>
| <select sublist> [ ( <comma> <select sublist> )... ]
<select sublist> ::=
  <derived column>
| <qualifier> <period> <asterisk>
<derived column> ::= <value expression> [ <as clause> ]
<as clause> ::= [ AS ] <column name>
<table expression> ::=
<from clause>
[ <where clause> ]
[ <group by clause> ]
[ <having clause> ]
<from clause> ::= FROM <table reference>
[ ( <comma> <table reference> )... ]
<table reference> ::=
  <table name> [ [ AS ] <correlation name>
      [ <left paren> <derived column list> <right paren> ] ]
| <derived table> [ AS ] <correlation name>
      [ <left paren> <derived column list> <right paren> ]
| <joined table>
<derived column list> ::= <column name list>
<derived table> ::= <table subquery>
<table subquery> ::= <subquery>
<joined table> ::=
  <cross join>
| <qualified join>
| <left paren> <joined table> <right paren>
<cross join> ::=
<table reference> CROSS JOIN <table reference>
<qualified join> ::=
<table reference> [ NATURAL ] [ <join type> ] JOIN
  <table reference> [ <join specification> ]
<join type> ::=
  INNER
| <outer join type> [ OUTER ]
| UNION
<outer join type> ::=
  LEFT
| RIGHT
| FULL

<join specification> ::=
      <join condition>
    | <named columns join>
<join condition> ::= ON <search condition>
<named columns join> ::=
    USING <left paren> <join column list> <right paren>
<join column list> ::= <column name list>
<where clause> ::= WHERE <search condition>
<group by clause> ::=
    GROUP BY <grouping column reference list>
<grouping column reference list> ::=
    <grouping column reference>
        [ ( <comma> <grouping column reference> )... ]
<grouping column reference> ::=
    <column reference> [ <collate clause> ]
<collate clause> ::= COLLATE <collation name>
<collation name> ::= <qualified name>
<having clause> ::= HAVING <search condition>
<table value constructor> ::=
    VALUES <table value constructor list>
<table value constructor list> ::=
    <row value constructor> [ ( <comma> <row value constructor> )... ]
<explicit table> ::= TABLE <table name>
<query term> ::=
      <non-join query term>
    | <joined table>
<corresponding spec> ::=
    CORRESPONDING [ BY <left paren> <corresponding column list> <right paren> ]
<corresponding column list> ::= <column name list>
<query primary> ::=
      <non-join query primary>
    | <joined table>
<case expression> ::=
      <case abbreviation>
    | <case specification>

<case abbreviation> ::=
      NULLIF <left paren> <value expression> <comma>
            <value expression> <right paren>
    | COALESCE <left paren> <value expression>
            ( <comma> <value expression> )... <right paren>
<case specification> ::=
      <simple case>
    | <searched case>
<simple case> ::=
    CASE <case operand>
      <simple when clause>...
      [ <else clause> ]
    END
<case operand> ::= <value expression>
<simple when clause> ::= WHEN <when operand> THEN <result>
<when operand> ::= <value expression>
<result> ::= <result expression> | NULL
<result expression> ::= <value expression>
<else clause> ::= ELSE <result>
<searched case> ::=
    CASE
      <searched when clause>...
      [ <else clause> ]
    END
<searched when clause> ::= WHEN <search condition> THEN <result>
<cast specification> ::=
    CAST <left paren> <cast operand> AS
        <cast target> <right paren>
<cast operand> ::=
      <value expression>
    | NULL
<cast target> ::=
      <domain name>
    | <data type>
<numeric value function> ::=
      <position expression>
    | <extract expression>
    | <length expression>
<position expression> ::=
    POSITION <left paren> <character value expression>

        IN <character value expression> <right paren>
<character value expression> ::=
      <concatenation>
    | <character factor>
<concatenation> ::=
    <character value expression> <concatenation operator>
        <character factor>
<character factor> ::=
    <character primary> [ <collate clause> ]
<character primary> ::=
      <value expression primary>
    | <string value function>
<string value function> ::=
      <character value function>
    | <bit value function>
<character value function> ::=
      <character substring function>
    | <fold>
    | <form-of-use conversion>
    | <character translation>
    | <trim function>
<character substring function> ::=
    SUBSTRING <left paren> <character value expression> FROM <start position>
                [ FOR <string length> ] <right paren>
<start position> ::= <numeric value expression>
<string length> ::= <numeric value expression>
<fold> ::= ( UPPER | LOWER )
     <left paren> <character value expression> <right paren>
<form-of-use conversion> ::=
    CONVERT <left paren> <character value expression>
        USING <form-of-use conversion name> <right paren>
<form-of-use conversion name> ::= <qualified name>
<character translation> ::=
    TRANSLATE <left paren> <character value expression>
        USING <translation name> <right paren>
<translation name> ::= <qualified name>
<trim function> ::=
    TRIM <left paren> <trim operands> <right paren>
<trim operands> ::=

[ [ <trim specification> ] [ <trim character> ] FROM ] <trim source>
<trim specification> ::=
  LEADING
| TRAILING
| BOTH
<trim character> ::= <character value expression>
<trim source> ::= <character value expression>
<bit value function> ::=
<bit substring function>
<bit substring function> ::=
SUBSTRING <left paren> <bit value expression> FROM <start position>
    [ FOR <string length> ] <right paren>
<bit value expression> ::=
  <bit concatenation>
| <bit factor>
<bit concatenation> ::=
<bit value expression> <concatenation operator> <bit factor>
<bit factor> ::= <bit primary>
<bit primary> ::=
  <value expression primary>
| <string value function>
<extract expression> ::=
EXTRACT <left paren> <extract field>
    FROM <extract source> <right paren>
<extract field> ::=
  <datetime field>
| <time zone field>
<datetime field> ::=
  <non-second datetime field>
| SECOND
<time zone field> ::=
  TIMEZONE_HOUR
| TIMEZONE_MINUTE
<extract source> ::=
  <datetime value expression>
| <interval value expression>
<datetime value expression> ::=
  <datetime term>
| <interval value expression> <plus sign> <datetime term>
| <datetime value expression> <plus sign> <interval term>

    | <datetime value expression> <minus sign> <interval term>
<interval term> ::=
      <interval factor>
    | <interval term 2> <asterisk> <factor>
    | <interval term 2> <solidus> <factor>
    | <term> <asterisk> <interval factor>
<interval factor> ::=
    [ <sign> ] <interval primary>
<interval primary> ::=
      <value expression primary> [ <interval qualifier> ]
<interval term 2> ::= <interval term>
<interval value expression> ::=
      <interval term>
    | <interval value expression 1> <plus sign> <interval term 1>
    | <interval value expression 1> <minus sign> <interval term 1>
    | <left paren> <datetime value expression> <minus sign>
          <datetime term> <right paren> <interval qualifier>
<interval value expression 1> ::= <interval value expression>
<interval term 1> ::= <interval term>
<datetime term> ::=
      <datetime factor>
<datetime factor> ::=
      <datetime primary> [ <time zone> ]
<datetime primary> ::=
      <value expression primary>
    | <datetime value function>
<time zone> ::=
    AT <time zone specifier>
<time zone specifier> ::=
      LOCAL
    | TIME ZONE <interval value expression>
<length expression> ::=
      <char length expression>
    | <octet length expression>
    | <bit length expression>
<char length expression> ::=
    ( CHAR_LENGTH | CHARACTER_LENGTH )
        <left paren> <string value expression> <right paren>
<string value expression> ::=
      <character value expression>

| <bit value expression>
<octet length expression> ::=
OCTET_LENGTH <left paren> <string value expression> <right paren>
<bit length expression> ::=
BIT_LENGTH <left paren> <string value expression> <right paren>
<null specification> ::=
NULL
<default specification> ::=
DEFAULT
<row value constructor list> ::=
<row value constructor element>
    [ ( <comma> <row value constructor element> )... ]
<row subquery> ::= <subquery>
<comp op> ::=
  <equals operator>
| <not equals operator>
| <less than operator>
| <greater than operator>
| <less than or equals operator>
| <greater than or equals operator>
<between predicate> ::=
<row value constructor> [ NOT ] BETWEEN
  <row value constructor> AND <row value constructor>
<in predicate> ::=
<row value constructor>
  [ NOT ] IN <in predicate value>
<in predicate value> ::=
  <table subquery>
| <left paren> <in value list> <right paren>
<in value list> ::=
<value expression> ( <comma> <value expression> )...
<like predicate> ::=
<match value> [ NOT ] LIKE <pattern>
  [ ESCAPE <escape character> ]
<match value> ::= <character value expression>
<pattern> ::= <character value expression>
<escape character> ::= <character value expression>
<null predicate> ::= <row value constructor>
IS [ NOT ] NULL

<quantified comparison predicate> ::=
    <row value constructor> <comp op> <quantifier> <table subquery>
<quantifier> ::= <all> | <some>
<all> ::= ALL
<some> ::= SOME | ANY
<exists predicate> ::= EXISTS <table subquery>
<unique predicate> ::= UNIQUE <table subquery>
<match predicate> ::=
    <row value constructor> MATCH [ UNIQUE ]
        [ PARTIAL | FULL ] <table subquery>
<overlaps predicate> ::=
    <row value constructor 1> OVERLAPS <row value constructor 2>
<row value constructor 1> ::= <row value constructor>
<row value constructor 2> ::= <row value constructor>
<truth value> ::=
      TRUE
    | FALSE
    | UNKNOWN
<constraint attributes> ::=
      <constraint check time> [ [ NOT ] DEFERRABLE ]
    | [ NOT ] DEFERRABLE [ <constraint check time> ]
<constraint check time> ::=
      INITIALLY DEFERRED
    | INITIALLY IMMEDIATE
<table constraint definition> ::=
    [ <constraint name definition> ]
    <table constraint> [ <constraint attributes> ]
<table constraint> ::=
      <unique constraint definition>
    | <referential constraint definition>
    | <check constraint definition>
<unique constraint definition> ::=
            <unique specification> even in SQL3)
    <unique specification>
      <left paren> <unique column list> <right paren>
<unique column list> ::= <column name list>
<referential constraint definition> ::=

    FOREIGN KEY
        <left paren> <referencing columns> <right paren>
      <references specification>
<referencing columns> ::=
    <reference column list>
<module contents> ::=
      <declare cursor>
    | <dynamic declare cursor>
    | <procedure>
<declare cursor> ::=
    DECLARE <cursor name> [ INSENSITIVE ] [ SCROLL ] CURSOR
      FOR <cursor specification>
<cursor name> ::= <identifier>
<cursor specification> ::=
    <query expression> [ <order by clause> ]
      [ <updatability clause> ]
<order by clause> ::=
    ORDER BY <sort specification list>
<sort specification list> ::=
    <sort specification> [ ( <comma> <sort specification> )... ]
<sort specification> ::=
    <sort key> [ <collate clause> ] [ <ordering specification> ]
<sort key> ::=
      <column name>
    | <unsigned integer>
<ordering specification> ::= ASC | DESC
<updatability clause> ::=
    FOR
        ( READ ONLY |
          UPDATE [ OF <column name list> ] )
<dynamic declare cursor> ::=
    DECLARE <cursor name> [ INSENSITIVE ] [ SCROLL ] CURSOR
        FOR <statement name>
<statement name> ::= <identifier>
<procedure> ::=
    PROCEDURE <procedure name>
        <parameter declaration list> <semicolon>
      <SQL procedure statement> <semicolon>
<procedure name> ::= <identifier>

<parameter declaration list> ::=
  <left paren> <parameter declaration>
      [ ( <comma> <parameter declaration> )... ] <right paren>
| <parameter declaration>...
<parameter declaration> ::=
  <parameter name> <data type>
| <status parameter>
<status parameter> ::=
SQLCODE | SQLSTATE
<SQL procedure statement> ::=
  <SQL schema statement>
| <SQL data statement>
| <SQL transaction statement>
| <SQL connection statement>
| <SQL session statement>
| <SQL dynamic statement>
| <SQL diagnostics statement>
<SQL schema statement> ::=
  <SQL schema definition statement>
| <SQL schema manipulation statement>
<SQL schema definition statement> ::=
  <schema definition>
| <table definition>
| <view definition>
| <grant statement>
| <domain definition>
| <character set definition>
| <collation definition>
| <translation definition>
| <assertion definition>
<schema definition> ::=
CREATE SCHEMA <schema name clause>
  [ <schema character set specification> ]
  [ <schema element>... ]
<schema name clause> ::=
  <schema name>
| AUTHORIZATION <schema authorization identifier>
| <schema name> AUTHORIZATION
      <schema authorization identifier>
<schema authorization identifier> ::=
<authorization identifier>
<schema character set specification> ::=
DEFAULT CHARACTER
    SET <character set specification>
<schema element> ::=

  <domain definition>
| <table definition>
| <view definition>
| <grant statement>
| <assertion definition>
| <character set definition>
| <collation definition>
| <translation definition>
<domain definition> ::=
CREATE DOMAIN <domain name>
    [ AS ] <data type>
  [ <default clause> ]
  [ <domain constraint>... ]
  [ <collate clause> ]
<domain constraint> ::=
[ <constraint name definition> ]
<check constraint definition> [ <constraint attributes> ]
<table definition> ::=
CREATE [ ( GLOBAL | LOCAL ) TEMPORARY ] TABLE
    <table name>
  <table element list>
  [ ON COMMIT ( DELETE | PRESERVE ) ROWS ]
<view definition> ::=
CREATE VIEW <table name> [ <left paren> <view column list>
                              <right paren> ]
  AS <query expression>
  [ WITH [ <levels clause> ] CHECK OPTION ]
<view column list> ::= <column name list>
<levels clause> ::=
CASCADED | LOCAL
<grant statement> ::=
GRANT <privileges> ON <object name>
 TO <grantee> [ ( <comma> <grantee> )... ]
   [ WITH GRANT OPTION ]
<privileges> ::=
  ALL PRIVILEGES
| <action list>
<action list> ::= <action> [ ( <comma> <action> )... ]
<action> ::=
  SELECT
| DELETE
| INSERT [ <left paren> <privilege column list> <right paren> ]
| UPDATE [ <left paren> <privilege column list> <right paren> ]
| REFERENCES [ <left paren> <privilege column list> <right paren> ]
| USAGE

<privilege column list> ::= <column name list>
<object name> ::=
  [ TABLE ] <table name>
| DOMAIN <domain name>
| COLLATION <collation name>
| CHARACTER SET <character set name>
| TRANSLATION <translation name>
<grantee> ::=
  PUBLIC
| <authorization identifier>
<assertion definition> ::=
CREATE ASSERTION <constraint name> <assertion check>
  [ <constraint attributes> ]
<assertion check> ::=
CHECK
    <left paren> <search condition> <right paren>
<character set definition> ::=
CREATE CHARACTER SET <character set name>
    [ AS ]
  <character set source>
  [ <collate clause> | <limited collation definition> ]
<character set source> ::=
  GET <existing character set name>
<existing character set name> ::=
  <standard character repertoire name>
| <implementation-defined character repertoire name>
| <schema character set name>
<schema character set name> ::= <character set name>
<limited collation definition> ::=
COLLATION FROM <collation source>
<collation source> ::=
  <collating sequence definition>
| <translation collation>
<collating sequence definition> ::=
  <external collation>
| <schema collation name>
| DESC <left paren> <collation name> <right paren>
| DEFAULT
<external collation> ::=
EXTERNAL <left paren> <quote> <external collation name> <quote> <right paren>
<external collation name> ::=

      <standard collation name>
    | <implementation-defined collation name>
<standard collation name> ::= <collation name>
<implementation-defined collation name> ::= <collation name>
<schema collation name> ::= <collation name>
<translation collation> ::=
    TRANSLATION <translation name>
        [ THEN COLLATION <collation name> ]
<collation definition> ::=
    CREATE COLLATION <collation name> FOR
        <character set specification>
      FROM <collation source>
        [ <pad attribute> ]
<pad attribute> ::=
      NO PAD
    | PAD SPACE
<translation definition> ::=
    CREATE TRANSLATION <translation name>
      FOR <source character set specification>
        TO <target character set specification>
      FROM <translation source>
<source character set specification> ::= <character set specification>
<target character set specification> ::= <character set specification>
<translation source> ::=
      <translation specification>
<translation specification> ::=
      <external translation>
    | IDENTITY
    | <schema translation name>
<external translation> ::=
    EXTERNAL <left paren> <quote> <external translation name> <quote> <right paren>
<external translation name> ::=
      <standard translation name>
    | <implementation-defined translation name>
<standard translation name> ::= <translation name>
<implementation-defined translation name> ::= <translation name>
<schema translation name> ::= <translation name>
<SQL schema manipulation statement> ::=

  <drop schema statement>
| <alter table statement>
| <drop table statement>
| <drop view statement>
| <revoke statement>
| <alter domain statement>
| <drop domain statement>
| <drop character set statement>
| <drop collation statement>
| <drop translation statement>
| <drop assertion statement>
<drop schema statement> ::=
DROP SCHEMA <schema name> <drop behavior>
<drop behavior> ::= CASCADE | RESTRICT
<alter table statement> ::=
ALTER TABLE <table name> <alter table action>
<alter table action> ::=
  <add column definition>
| <alter column definition>
| <drop column definition>
| <add table constraint definition>
| <drop table constraint definition>
<add column definition> ::=
ADD [ COLUMN ] <column definition>
<alter column definition> ::=
ALTER [ COLUMN ] <column name> <alter column action>
<alter column action> ::=
  <set column default clause>
| <drop column default clause>
<set column default clause> ::=
SET <default clause>
<drop column default clause> ::=
DROP DEFAULT
<drop column definition> ::=
DROP [ COLUMN ] <column name> <drop behavior>
<add table constraint definition> ::=
ADD <table constraint definition>
<drop table constraint definition> ::=
DROP CONSTRAINT <constraint name> <drop behavior>
<drop table statement> ::=
DROP TABLE <table name> <drop behavior>

<drop view statement> ::=
DROP VIEW <table name> <drop behavior>
<revoke statement> ::=
REVOKE [ GRANT OPTION FOR ]
    <privileges>
    ON <object name>
  FROM <grantee> [ ( <comma> <grantee> )... ] <drop behavior>
<alter domain statement> ::=
ALTER DOMAIN <domain name> <alter domain action>
<alter domain action> ::=
  <set domain default clause>
| <drop domain default clause>
| <add domain constraint definition>
| <drop domain constraint definition>
<set domain default clause> ::= SET <default clause>
<drop domain default clause> ::= DROP DEFAULT
<add domain constraint definition> ::=
ADD <domain constraint>
<drop domain constraint definition> ::=
DROP CONSTRAINT <constraint name>
<drop domain statement> ::=
DROP DOMAIN <domain name> <drop behavior>
<drop character set statement> ::=
DROP CHARACTER SET <character set name>
<drop collation statement> ::=
DROP COLLATION <collation name>
<drop translation statement> ::=
DROP TRANSLATION <translation name>
<drop assertion statement> ::=
DROP ASSERTION <constraint name>
<SQL data statement> ::=
  <open statement>
| <fetch statement>
| <close statement>
| <select statement: single row>
| <SQL data change statement>
<open statement> ::=
OPEN <cursor name>
<fetch statement> ::=
FETCH [ [ <fetch orientation> ] FROM ]

  <cursor name> INTO <fetch target list>
<fetch orientation> ::=
  NEXT
| PRIOR
| FIRST
| LAST
| ( ABSOLUTE | RELATIVE ) <simple value specification>
<simple value specification> ::=
  <parameter name>
| <embedded variable name>
| <literal>
<fetch target list> ::=
<target specification> [ ( <comma> <target specification> )... ]
<target specification> ::=
  <parameter specification>
| <variable specification>
<close statement> ::=
CLOSE <cursor name>
<select statement: single row> ::=
SELECT [ <set quantifier> ] <select list>
  INTO <select target list>
    <table expression>
<select target list> ::=
<target specification> [ ( <comma> <target specification> )... ]
<SQL data change statement> ::=
  <delete statement: positioned>
| <delete statement: searched>
| <insert statement>
| <update statement: positioned>
| <update statement: searched>
<delete statement: positioned> ::=
DELETE FROM <table name>
  WHERE CURRENT OF <cursor name>
<delete statement: searched> ::=
DELETE FROM <table name>
  [ WHERE <search condition> ]
<insert statement> ::=
INSERT INTO <table name>
  <insert columns and source>
<insert columns and source> ::=
  [ <left paren> <insert column list> <right paren> ]
        <query expression>
| DEFAULT VALUES

<insert column list> ::= <column name list>
<update statement: positioned> ::=
UPDATE <table name>
  SET <set clause list>
    WHERE CURRENT OF <cursor name>
<set clause list> ::=
<set clause> [ ( <comma> <set clause> )... ]
<set clause> ::=
<object column> <equals operator> <update source>
<object column> ::= <column name>
<update source> ::=
  <value expression>
| <null specification>
| DEFAULT
<update statement: searched> ::=
UPDATE <table name>
  SET <set clause list>
  [ WHERE <search condition> ]
<SQL transaction statement> ::=
  <set transaction statement>
| <set constraints mode statement>
| <commit statement>
| <rollback statement>
<set transaction statement> ::=
SET TRANSACTION <transaction mode>
    [ ( <comma> <transaction mode> )... ]
<transaction mode> ::=
  <isolation level>
| <transaction access mode>
| <diagnostics size>
<isolation level> ::=
ISOLATION LEVEL <level of isolation>
<level of isolation> ::=
  READ UNCOMMITTED
| READ COMMITTED
| REPEATABLE READ
| SERIALIZABLE
<transaction access mode> ::=
  READ ONLY
| READ WRITE
<diagnostics size> ::=

    DIAGNOSTICS SIZE <number of conditions>
<number of conditions> ::= <simple value specification>
<set constraints mode statement> ::=
    SET CONSTRAINTS <constraint name list>
        ( DEFERRED | IMMEDIATE )
<constraint name list> ::=
      ALL
    | <constraint name> [ ( <comma> <constraint name> )... ]
<commit statement> ::=
    COMMIT [ WORK ]
<rollback statement> ::=
    ROLLBACK [ WORK ]
<SQL connection statement> ::=
      <connect statement>
    | <set connection statement>
    | <disconnect statement>
<connect statement> ::=
    CONNECT TO <connection target>
<connection target> ::=
      <SQL-server name>
        [ AS <connection name> ]
          correspondence with Tony Gordon)
        [ USER <user name> ]
    | DEFAULT
<SQL-server name> ::= <simple value specification>
<connection name> ::= <simple value specification>
<user name> ::= <simple value specification>
<set connection statement> ::=
    SET CONNECTION <connection object>
<connection object> ::=
      DEFAULT
    | <connection name>
<disconnect statement> ::=
    DISCONNECT <disconnect object>
<disconnect object> ::=
      <connection object>
    | ALL
    | CURRENT
<SQL session statement> ::=

  <set catalog statement>
| <set schema statement>
| <set names statement>
| <set session authorization identifier statement>
| <set local time zone statement>
<set catalog statement> ::=
SET CATALOG <value specification>
<value specification> ::=
  <literal>
| <general value specification>
<set schema statement> ::=
SET SCHEMA <value specification>
<set names statement> ::=
SET NAMES <value specification>
<set session authorization identifier statement> ::=
SET SESSION AUTHORIZATION
    <value specification>
<set local time zone statement> ::=
SET TIME ZONE
    <set time zone value>
<set time zone value> ::=
  <interval value expression>
| LOCAL
<SQL dynamic statement> ::=
  <system descriptor statement>
| <prepare statement>
| <deallocate prepared statement>
| <describe statement>
| <execute statement>
| <execute immediate statement>
| <SQL dynamic data statement>
<system descriptor statement> ::=
  <allocate descriptor statement>
| <deallocate descriptor statement>
| <set descriptor statement>
| <get descriptor statement>
<allocate descriptor statement> ::=
ALLOCATE DESCRIPTOR <descriptor name>
   [ WITH MAX <occurrences> ]
<descriptor name> ::=
[ <scope option> ] <simple value specification>
<scope option> ::=
  GLOBAL

| LOCAL
<occurrences> ::= <simple value specification>
<deallocate descriptor statement> ::=
DEALLOCATE DESCRIPTOR <descriptor name>
<set descriptor statement> ::=
SET DESCRIPTOR <descriptor name>
    <set descriptor information>
<set descriptor information> ::=
  <set count>
| VALUE <item number>
    <set item information> [ ( <comma> <set item information> )... ]
<set count> ::=
COUNT <equals operator> <simple value specification 1>
<simple value specification 1> ::= <simple value specification>
<item number> ::= <simple value specification>
<set item information> ::=
<descriptor item name> <equals operator> <simple value specification 2>
<descriptor item name> ::=
  TYPE
| LENGTH
| OCTET_LENGTH
| RETURNED_LENGTH
| RETURNED_OCTET_LENGTH
| PRECISION
| SCALE
| DATETIME_INTERVAL_CODE
| DATETIME_INTERVAL_PRECISION
| NULLABLE
| INDICATOR
| DATA
| NAME
| UNNAMED
| COLLATION_CATALOG
| COLLATION_SCHEMA
| COLLATION_NAME
| CHARACTER_SET_CATALOG
| CHARACTER_SET_SCHEMA
| CHARACTER_SET_NAME
<simple value specification 2> ::= <simple value specification>
<item number> ::= <simple value specification>
<get descriptor statement> ::=
GET DESCRIPTOR <descriptor name> <get descriptor information>

<get descriptor information> ::=
      <get count>
    | VALUE <item number>
        <get item information> [ ( <comma> <get item information> )... ]
<get count> ::=
    <simple target specification 1> <equals operator>
         COUNT
<simple target specification 1> ::= <simple target specification>
<simple target specification> ::=
      <parameter name>
    | <embedded variable name>
<get item information> ::=
    <simple target specification 2> <equals operator> <descriptor item name>>
<simple target specification 2> ::= <simple target specification>
<prepare statement> ::=
    PREPARE <SQL statement name> FROM <SQL statement variable>
<SQL statement name> ::=
      <statement name>
    | <extended statement name>
<extended statement name> ::=
    [ <scope option> ] <simple value specification>
<SQL statement variable> ::= <simple value specification>
<deallocate prepared statement> ::=
    DEALLOCATE PREPARE <SQL statement name>
<describe statement> ::=
      <describe input statement>
    | <describe output statement>
<describe input statement> ::=
    DESCRIBE INPUT <SQL statement name> <using descriptor>
<using descriptor> ::=
    ( USING | INTO ) SQL DESCRIPTOR <descriptor name>
<describe output statement> ::=
    DESCRIBE [ OUTPUT ] <SQL statement name> <using descriptor>
<execute statement> ::=
    EXECUTE <SQL statement name>
      [ <result using clause> ]
      [ <parameter using clause> ]
<result using clause> ::= <using clause>

<using clause> ::=
  <using arguments>
| <using descriptor>
<using arguments> ::=
( USING | INTO ) <argument> [ ( <comma> <argument> )... ]
<argument> ::= <target specification>
<parameter using clause> ::= <using clause>
<execute immediate statement> ::=
EXECUTE IMMEDIATE <SQL statement variable>
<SQL dynamic data statement> ::=
  <allocate cursor statement>
| <dynamic open statement>
| <dynamic fetch statement>
| <dynamic close statement>
| <dynamic delete statement: positioned>
| <dynamic update statement: positioned>
<allocate cursor statement> ::=
ALLOCATE <extended cursor name> [ INSENSITIVE ]
    [ SCROLL ] CURSOR
  FOR <extended statement name>
<extended cursor name> ::=
[ <scope option> ] <simple value specification>
<dynamic open statement> ::=
OPEN <dynamic cursor name> [ <using clause> ]
<dynamic cursor name> ::=
  <cursor name>
| <extended cursor name>
<dynamic fetch statement> ::=
FETCH [ [ <fetch orientation> ] FROM ] <dynamic cursor name>
    <using clause>
<dynamic close statement> ::=
CLOSE <dynamic cursor name>
<dynamic delete statement: positioned> ::=
DELETE FROM <table name>
  WHERE CURRENT OF
      <dynamic cursor name>
<dynamic update statement: positioned> ::=
UPDATE <table name>
  SET <set clause>
      [ ( <comma> <set clause> )... ]
    WHERE CURRENT OF
        <dynamic cursor name>

<SQL diagnostics statement> ::=
<get diagnostics statement>
<get diagnostics statement> ::=
GET DIAGNOSTICS <sql diagnostics information>
<sql diagnostics information> ::=
  <statement information>
| <condition information>
<statement information> ::=
<statement information item> [ ( <comma> <statement information item> )... ]
<statement information item> ::=
<simple target specification> <equals operator> <statement information item name>
<statement information item name> ::=
  NUMBER
| MORE
| COMMAND_FUNCTION
| DYNAMIC_FUNCTION
| ROW_COUNT
<condition information> ::=
EXCEPTION <condition number>
  <condition information item> [ ( <comma> <condition information item> )... ]
<condition number> ::= <simple value specification>
<condition information item> ::=
<simple target specification> <equals operator> <condition information item name>
<condition information item name> ::=
  CONDITION_NUMBER
| RETURNED_SQLSTATE
| CLASS_ORIGIN
| SUBCLASS_ORIGIN
| SERVER_NAME
| CONNECTION_NAME
| CONSTRAINT_CATALOG
| CONSTRAINT_SCHEMA
| CONSTRAINT_NAME
| CATALOG_NAME
| SCHEMA_NAME
| TABLE_NAME
| COLUMN_NAME
| CURSOR_NAME
| MESSAGE_TEXT
| MESSAGE_LENGTH
| MESSAGE_OCTET_LENGTH
<embedded SQL host program> ::=
  <embedded SQL Ada program>
| <embedded SQL C program>

| <embedded SQL COBOL program>
| <embedded SQL Fortran program>
| <embedded SQL MUMPS program>
| <embedded SQL Pascal program>
| <embedded SQL PL/I program>
<embedded SQL Ada program> ::= !! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL C program> ::=
  !! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL COBOL program> ::= !! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL Fortran program> ::=
!! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL MUMPS program> ::= !! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL Pascal program> ::=
!! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL PL/I program> ::= !! <EMPHASIS>(See the Syntax Rules.)
<embedded SQL declare section> ::=
  <embedded SQL begin declare>
    [ <embedded character set declaration> ]
    [ <host variable definition>... ]
  <embedded SQL end declare>
| <embedded SQL MUMPS declare>
<embedded SQL begin declare> ::=
<SQL prefix> BEGIN DECLARE SECTION
    [ <SQL terminator> ]
<SQL prefix> ::=
  EXEC SQL
| <ampersand>SQL<left paren>
<SQL terminator> ::=
  END-EXEC
| <semicolon>
| <right paren>
<embedded character set declaration> ::=
SQL NAMES ARE <character set specification>
<host variable definition> ::=
  <Ada variable definition>
| <C variable definition>
| <COBOL variable definition>
| <Fortran variable definition>
| <MUMPS variable definition>
| <Pascal variable definition>
| <PL/I variable definition>

<Ada variable definition> ::=
<Ada host identifier> [ ( <comma> <Ada host identifier> )... ] :
<Ada type specification> [ <Ada initial value> ]
<Ada type specification> ::=
  <Ada qualified type specification>
| <Ada unqualified type specification>
<Ada qualified type specification> ::=
  SQL_STANDARD.CHAR [ CHARACTER SET
     [ IS ] <character set specification> ]
      <left paren> 1 <double period> <length> <right paren>
| SQL_STANDARD.BIT
      <left paren> 1 <double period> <length> <right paren>
| SQL_STANDARD.SMALLINT
| SQL_STANDARD.INT
| SQL_STANDARD.REAL
| SQL_STANDARD.DOUBLE_PRECISION
| SQL_STANDARD.SQLCODE_TYPE
| SQL_STANDARD.SQLSTATE_TYPE
| SQL_STANDARD.INDICATOR_TYPE
<Ada unqualified type specification> ::=
  CHAR
      <left paren> 1 <double period> <length> <right paren>
| BIT
      <left paren> 1 <double period> <length> <right paren>
| SMALLINT
| INT
| REAL
| DOUBLE_PRECISION
| SQLCODE_TYPE
| SQLSTATE_TYPE
| INDICATOR_TYPE
<Ada initial value> ::=
<Ada assignment operator> <character representation>...
<Ada assignment operator> ::= <colon><equals operator>
<C variable definition> ::=
  [ <C storage class> ]
  [ <C class modifier> ]
  <C variable specification>
<semicolon>
<C storage class> ::=
  auto
| extern
| static
<C class modifier> ::= const | volatile
<C variable specification> ::=
  <C numeric variable>

| <C character variable>
| <C derived variable>
<C numeric variable> ::=
( long | short | float | double )
  <C host identifier> [ <C initial value> ]
        [ ( <comma> <C host identifier> [ <C initial value> ] )... ]
<C initial value> ::=
<equals operator> <character representation>...
<C character variable> ::=
char [ CHARACTER SET
         [ IS ] <character set specification> ]
  <C host identifier>
    <C array specification> [ <C initial value> ]
    [ ( <comma> <C host identifier>
      <C array specification>
             [ <C initial value> ] )... ]
<C array specification> ::=
<left bracket> <length> <right bracket>
<C derived variable> ::=
  <C VARCHAR variable>
| <C bit variable>
<C VARCHAR variable> ::=
VARCHAR [ CHARACTER SET [ IS ]
    <character set specification> ]
    <C host identifier>
        <C array specification> [ <C initial value> ]
      [ ( <comma> <C host identifier>
          <C array specification>
                  [ <C initial value> ] )... ]
<C bit variable> ::=
BIT <C host identifier>
    <C array specification> [ <C initial value> ]
  [ ( <comma> <C host identifier>
    <C array specification>
               [ <C initial value> ] )... ]
<COBOL variable definition> ::=
(01|77) <COBOL host identifier> <COBOL type specification>
  [ <character representation>... ] <period>
<COBOL type specification> ::=
  <COBOL character type>
| <COBOL bit type>
| <COBOL numeric type>
| <COBOL integer type>
<COBOL character type> ::=
[ CHARACTER SET [ IS ]

      <character set specification> ]
( PIC | PICTURE ) [ IS ] ( X [ <left paren> <length> <right paren> ] )...
<COBOL bit type> ::=
( PIC | PICTURE ) [ IS ]
    ( B [ <left paren> <length> <right paren> ] )...
<COBOL numeric type> ::=
( PIC | PICTURE ) [ IS ]
  S <COBOL nines specification>
[ USAGE [ IS ] ] DISPLAY SIGN LEADING SEPARATE
<COBOL nines specification> ::=
  <COBOL nines> [ V [ <COBOL nines> ] ]
| V <COBOL nines>
<COBOL nines> ::= ( 9 [ <left paren> <length> <right paren> ] )...
<COBOL integer type> ::=
  <COBOL computational integer>
| <COBOL binary integer>
<COBOL computational integer> ::=
( PIC | PICTURE ) [ IS ] S<COBOL nines>
  [ USAGE [ IS ] ] ( COMP | COMPUTATIONAL )
<COBOL binary integer> ::=
( PIC | PICTURE ) [ IS ] S<COBOL nines>
  [ USAGE [ IS ] ] BINARY
<Fortran variable definition> ::=
<Fortran type specification>
<Fortran host identifier>
    [ ( <comma> <Fortran host identifier> )... ]
<Fortran type specification> ::=
  CHARACTER [ <asterisk> <length> ]
      [ CHARACTER SET [ IS ]
            <character set specification> ]
| BIT [ <asterisk> <length> ]
| INTEGER
| REAL
| DOUBLE PRECISION
<MUMPS variable definition> ::=
( <MUMPS numeric variable> | <MUMPS character variable> )
    <semicolon>
<MUMPS numeric variable> ::=
<MUMPS type specification>
  <MUMPS host identifier> [ ( <comma> <MUMPS host identifier> )... ]
<MUMPS type specification> ::=
  INT
| DEC

      [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| REAL
<MUMPS character variable> ::=
VARCHAR <MUMPS host identifier> <MUMPS length specification>
  [ ( <comma> <MUMPS host identifier> <MUMPS length specification> )... ]
<MUMPS length specification> ::=
<left paren> <length> <right paren>
<Pascal variable definition> ::=
<Pascal host identifier> [ ( <comma> <Pascal host identifier> )... ] <colon>
  <Pascal type specification> <semicolon>
<Pascal type specification> ::=
  PACKED ARRAY
      <left bracket> 1 <double period> <length> <right bracket>
    OF CHAR
      [ CHARACTER SET [ IS ]
            <character set specification> ]
| PACKED ARRAY
      <left bracket> 1 <double period> <length> <right bracket>
    OF BIT
| INTEGER
| REAL
| CHAR [ CHARACTER SET
                            [ IS ] <character set specification> ]
| BIT
<PL/I variable definition> ::=
(DCL | DECLARE)
    (   <PL/I host identifier>
      | <left paren> <PL/I host identifier>
            [ ( <comma> <PL/I host identifier> )... ] <right paren> )
<PL/I type specification>
[ <character representation>... ] <semicolon>
<PL/I type specification> ::=
  ( CHAR | CHARACTER ) [ VARYING ]
      <left paren><length><right paren>
      [ CHARACTER SET
            [ IS ] <character set specification> ]
| BIT [ VARYING ] <left paren><length><right paren>
| <PL/I type fixed decimal> <left paren> <precision>
      [ <comma> <scale> ] <right paren>
| <PL/I type fixed binary> [ <left paren> <precision> <right paren> ]
| <PL/I type float binary> <left paren> <precision> <right paren>
<PL/I type fixed decimal> ::=
  ( DEC | DECIMAL ) FIXED
| FIXED ( DEC | DECIMAL )
<PL/I type fixed binary> ::=
  ( BIN | BINARY ) FIXED
| FIXED ( BIN | BINARY )

<PL/I type float binary> ::=
  ( BIN | BINARY ) FLOAT
| FLOAT ( BIN | BINARY )
<embedded SQL end declare> ::=
<SQL prefix> END DECLARE SECTION
    [ <SQL terminator> ]
<embedded SQL MUMPS declare> ::=
<SQL prefix>
  BEGIN DECLARE SECTION
    [ <embedded character set declaration> ]
    [ <host variable definition>... ]
  END DECLARE SECTION
<SQL terminator>
<embedded SQL statement> ::=
<SQL prefix>
  <statement or declaration>
[ <SQL terminator> ]
<statement or declaration> ::=
  <declare cursor>
| <dynamic declare cursor>
| <temporary table declaration>
| <embedded exception declaration>
| <SQL procedure statement>
<embedded exception declaration> ::=
WHENEVER <condition> <condition action>
<condition> ::=
SQLERROR | NOT FOUND
<condition action> ::=
CONTINUE | <go to>
<go to> ::=
( GOTO | GO TO ) <goto target>
<goto target> ::=
  <host label identifier>
| <unsigned integer>
| <host PL/I label variable>
<host label identifier> ::= !!<EMPHASIS>(See the Syntax Rules.)
<host PL/I label variable> ::= !!<EMPHASIS>(See the Syntax Rules.)
<preparable statement> ::=
  <preparable SQL data statement>
| <preparable SQL schema statement>
| <preparable SQL transaction statement>
| <preparable SQL session statement>

| <preparable implementation-defined statement>
<preparable SQL data statement> ::=
  <delete statement: searched>
| <dynamic single row select statement>
| <insert statement>
| <dynamic select statement>
| <update statement: searched>
| <preparable dynamic delete statement: positioned>
| <preparable dynamic update statement: positioned>
<dynamic single row select statement> ::= <query specification>
<dynamic select statement> ::= <cursor specification>
<preparable dynamic delete statement: positioned> ::=
DELETE [ FROM <table name> ]
  WHERE CURRENT OF <cursor name>
<preparable dynamic update statement: positioned> ::=
UPDATE [ <table name> ]
  SET <set clause list>
  WHERE CURRENT OF <cursor name>
<preparable SQL schema statement> ::=
  <SQL schema statement>
<preparable SQL transaction statement> ::=
  <SQL transaction statement>
<preparable SQL session statement> ::=
  <SQL session statement>
<preparable implementation-defined statement> ::=
!! <EMPHASIS>(See the Syntax Rules.)
<direct SQL statement> ::=
<directly executable statement> <semicolon>
<directly executable statement> ::=
  <direct SQL data statement>
| <SQL schema statement>
| <SQL transaction statement>
| <SQL connection statement>
| <SQL session statement>
| <direct implementation-defined statement>
<direct SQL data statement> ::=
  <delete statement: searched>
| <direct select statement: multiple rows>
| <insert statement>
| <update statement: searched>
| <temporary table declaration>
<direct select statement: multiple rows> ::=

B. Pararthma B - Odhgos Ekma8hshs SQL gia arxarioys 118

    <query expression> [ <order by clause> ]
<direct implementation-defined statement> ::=
    !!<EMPHASIS>(See the Syntax Rules)
<SQL object identifier> ::=
    <SQL provenance> <SQL variant>
<SQL provenance> ::= <arc1> <arc2> <arc3>
<arc1> ::= iso | 1 | iso <left paren> 1 <right paren>
<arc2> ::= standard | 0 | standard <left paren> 0 <right paren>
<arc3> ::= 9075
<SQL variant> ::= <SQL edition> <SQL conformance>
<SQL edition> ::= <1987> | <1989> | <1992>
<1987> ::= 0 | edition1987 <left paren> 0 <right paren>
<1989> ::= <1989 base> <1989 package>
<1989 base> ::= 1 | edition1989 <left paren> 1 <right paren>
<1989 package> ::= <integrity no> | <integrity yes>
<integrity no> ::= 0 | IntegrityNo <left paren> 0 <right paren>
<integrity yes> ::= 1 | IntegrityYes <left paren> 1 <right paren>
<1992> ::= 2 | edition1992 <left paren> 2 <right paren>
<SQL conformance> ::= <low> | <intermediate> | <high>
<low> ::= 0 | Low <left paren> 0 <right paren>
<intermediate> ::= 1 | Intermediate <left paren> 1 <right paren>
<high> ::= 2 | High <left paren> 2 <right paren>

B Pararthma B - Odhgos Ekma8hshs SQL gia arxarioys

B.1 Odhgos Ekma8hshs gia PostgreSQL

Mazi me th dianomh ths PostgreSQL dianeimetai odhgos ekma8hshs SQL. Ta scripts toy odhgou ekma8hshs SQL briskontai ston katalogo src/tutorial

B.2 Deiktes Internet diey8unsewn

Oi arxarioi mporoun na broyn odhgo ekma8hshs SQL sto

• <http://w3.one.net/~jhoffman/sqltut.htm>

Sxolia h ypodeijeis; Steilte mail sto

• jhoffman@one.net

Ta parakatw sites proteinontai apo ton John Hoffman:

• Egxeiridio SQL <http://www.contrib.andrew.cmu.edu/~shadow/sql.html>
• Epikoinwnhste me thn SQL Pro <http://www.inquiry.com/techtips/thesqlpro/>

• Xrhsima Sites gia th sxesiakh bash dedomenwn SQL Pro <http://www.inquiry.com/techtips/

  thesqlpro/usefulsites.html>
• Kwdikas gia programmatistes <http://infoweb.magi.com/~steve/develop.html>

• DBMS Sites <http://info.itu.ch/special/wwwfiles> Phgainete edw kai deite to arxeio comp db.html

• DB Ingredients <http://www.compapp.dcu.ie/databases/f017.html>
• Web Authoring <http://www.stars.com/Tutorial/CGI/>
• Computing Dictionary <http://wfn-shop.princeton.edu/cgi-bin/foldoc>
• DBMS Lab/Links <http://www-ccs.cs.umass.edu/db.html>
• SQL FAQ <http://epoch.CS.Berkeley.EDU:8000/sequoia/dba/montage/FAQ> Phgainete edw kai

deite to arxeio SQL TOC.html

• Baseis SQL <http://chaos.mur.csu.edu.au/itc125/cgi/sqldb.html>
• RIT Selida gia Sxediasmo Basewn  <http://www.it.rit.edu/~wjs/IT/199602/icsa720/
  icsa720postings.html>
• Database Jump Site <http://www.pcslink.com/~ej/dbweb.html>
• Boh8hmata programmatismou sto Web <http://www.eng.uc.edu/~jtilley/tutorial.html>
• Phges gia Programmatistes <http://www.ndev.com/ndc2/support/resources.htp>
• Lista erwthsewn <http://ashok.pair.com/sql.htm>
• Diafora IMAGE SQL <http://jazz.external.hp.com/training/sqltables/main.html>
• Internet Resource List <http://www.eit.com/web/netservices.html>

C Appendix C - Odhgies gia grhgorh egkatastash Linux

An skopeuete na xrhsimopoihsete th PostgreSQL se Linux, kai xreiazeste boh8eia kata thn egkatastash sto Linux, episkefteite toys deiktes poy 8a breite sto Appendix. Kaluptoyn ta parakatw 8emata -

• Xarakthristika toy Linux - Giati to Linux einai kalutero gia ejyphrethth basewn dedomenwn se sugkrish me ta Windows 95/NT

• Odhgies gia 10lepth grhgorh egkatastash Linux • Lista analogiwn Microsoft-Linux

• Grhgora bhmata gia na metaglwttisete ton pyrhna Linux

• Main Site is at <http://members.spree.com/technology/aldev/>
• Mirror site <http://aldev.8m.com>
• Mirror site <http://aldev.webjump.com>
• Mirror site <http://homepages.infoseek.com/~aldev1/index.html>
• Mirror site <http://www3.bcity.com/aldev/>