1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
|
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: n/a Maintainer: kgergely Status: ready, but not updated... -->
<reference id="ref.pgsql">
<title>PostgreSQL fggvnyek</title>
<titleabbrev>PostgreSQL</titleabbrev>
<partintro>
<para>
Postgres, amit eredetileg a UC Berkeley Computer Science
Department fejlesztett ki, ttr volt az objektum-relcis adatmodellek terletn, s most elrhetv vlik tbb kereskedelmi adatbzisban is.
Tmogatja az SQL92/SQL3 nyelv hasznlatt, tranzakcik integritst s a
tpusok kiterjeszthetsgt. A PostgreSQL egy public-domain,
nylt forrs leszrmazottja ennek az eredeti Berkeley kdnak.
</para>
<para>
A PostgreSQL ingyenes. A legjabb verzi a
<ulink url="&url.pgsql;">www.PostgreSQL.org</ulink> cmen rhet el.
</para>
<para>
A 6.3 verzi ta (03/02/1998) a PostgreSQL unix socketeket hasznl.
A lenti tblzat mutatja az j kapcsolatteremtsi lehetsgeket.
Ez a socket a <filename>/tmp/.s.PGSQL.5432</filename> nven rhet el.
Ezt az opcit a <command>postmaster</command> parancs '-i'
kapcsoljval rheted el, a jelentse pedig:
"figyeld a TCP/IP socketeket is gy, mint a unix socketeket".
<table>
<title>Postmaster s a PHP</title>
<tgroup cols="3">
<thead>
<row>
<entry>Postmaster</entry>
<entry>PHP</entry>
<entry>llapot</entry>
</row>
</thead>
<tbody>
<row>
<entry>postmaster &</entry>
<entry>pg_connect("", "", "", "", "dbname");</entry>
<entry>OK</entry>
</row>
<row>
<entry>postmaster -i &</entry>
<entry>pg_connect("", "", "", "", "dbname");</entry>
<entry>OK</entry>
</row>
<row>
<entry>postmaster &</entry>
<entry>pg_connect("localhost", "", "", "", "dbname");</entry>
<entry>
Unable to connect to PostgreSQL server: connectDB() failed:
Is the postmaster running and accepting TCP/IP (with -i)
connection at 'localhost' on port '5432'? in
/path/to/file.php3 on line 20.
vagyis:
Nem lehet kapcsoldni a PostgreSQL szerverhez: a connectDB() hvs
meghisult. Fut a postmaster, s fogadja a TCP/IP kapcsolatokat (-i)
a helyi gpen az 5432-es porton? a
/elrsi_t/a/file.php3 a 20-as sorban
</entry>
</row>
<row>
<entry>postmaster -i &</entry>
<entry>pg_connect("localhost", "", "", "", "dbname");</entry>
<entry>OK</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
A kvetkezkpp is kezdhetsz kapcsolatot:
<command>$conn = pg_Connect("host=localhost port=5432
dbname=chris");</command>
</para>
<para>
Annak rdekben, hogy hasznlhassunk nagy objektum felletet (lo),
szksges az egszet egy tranzakcis blokkba foglalni. A tranzakcis
blokk egy <command>begin</command>-nel kezddik, s ha a tranzakci
rvnyes, egy <command>commit</command>-tal vagy egy
<command>end</command>-del vgzdik. Ha a tranzakci meghisul, akkor
<command>rollback</command> vagy <command>abort</command> paranccsal
kell vgzdnie.
<example>
<title>Nagy objektumok hasznlata</title>
<programlisting role="php">
<?php
$database = pg_Connect ("", "", "", "", "jacarta");
pg_exec ($database, "begin");
$oid = pg_locreate ($database);
echo ("$oid\n");
$handle = pg_loopen ($database, $oid, "w");
echo ("$handle\n");
pg_lowrite ($handle, "gaga");
pg_loclose ($handle);
pg_exec ($database, "commit");
?>
</programlisting>
</example>
</para>
</partintro>
<refentry id="function.pg-close">
<refnamediv>
<refname>pg_Close</refname>
<refpurpose>lezr egy PostgreSQL kapcsolatot</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>bool</type><methodname>pg_close</methodname>
<methodparam><type>int</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
Hamissal tr vissza, ha a connection rvnytelen kapcsolatazonost,
egybknt igazzal. Lezrja az adott azonostj kapcsolatot a
PostgreSQL adatbzissal.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-cmdtuples">
<refnamediv>
<refname>pg_cmdTuples</refname>
<refpurpose>az rintett sorok szmt adja vissza</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_cmdtuples</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_cmdTuples</function> az INSERT, UPDATE vagy DELETE
krsek ltal rintett sorokat adja vissza. Ha egyetlen sor sem
rintett, az eredmny 0 lesz.
<example>
<title>pg_cmdtuples</title>
<programlisting role="php">
<?php
$result = pg_exec($conn, "INSERT INTO verlag VALUES ('Autor')");
$cmdtuples = pg_cmdtuples($result);
echo $cmdtuples . " <- cmdtuples affected.";
?>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.pg-connect">
<refnamediv>
<refname>pg_Connect</refname>
<refpurpose>megnyit egy kapcsolatot</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_connect</methodname>
<methodparam><type>string</type><parameter>host</parameter></methodparam>
<methodparam><type>string</type><parameter>port</parameter></methodparam>
<methodparam><type>string</type><parameter>options</parameter></methodparam>
<methodparam><type>string</type><parameter>tty</parameter></methodparam>
<methodparam><type>string</type><parameter>dbname</parameter></methodparam>
</methodsynopsis>
<para>
Sikeres vgrehajts esetn egy kapcsolat-azonostval tr vissza,
vagy hamissal, ha a kapcsolat nem hozhat ltre. Kapcsolatot nyit
egy PostgreSQL adatbzishoz. Az sszes argumentum vltoz-interpollt,
belertve a porszmot is. Az options s a tty argumentumok opcionlisak,
vagyis elhagyhatk. Ez a fggvny egy kapcsolat-azonostval tr vissza,
mely ms PostgreSQL fggvnyek hasznlathoz szksges. Egyszerre
tbb kapcsolatot is tudsz nyitni.
</para>
<para>
Kapcsolat ltrehozsra alkalmas az albbi parancs is:
<command>$conn = pg_connect("dbname=marliese port=5432");</command>
A <parameter>dbname</parameter> s a
<parameter>port</parameter> paramter mellett mg hasznlhat a
<parameter>host</parameter>,
<parameter>tty</parameter>,
<parameter>options</parameter>,
<parameter>user</parameter> s a
<parameter>password</parameter>.
</para>
<para>
Lsd mg a <function>pg_pConnect</function> fggvnyt.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-dbname">
<refnamediv>
<refname>pg_DBname</refname>
<refpurpose>adatbzis neve</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_dbname</methodname>
<methodparam><type>int</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
Az adott kapcsolatazonostj PostgreSQL adatbzisnevvel tr vissza, vagy hamissal, ha a kapcsolat-azonost rvnytelen.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-errormessage">
<refnamediv>
<refname>pg_ErrorMessage</refname>
<refpurpose>hibazenet</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_errormessage</methodname>
<methodparam><type>int</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
Egy hibazenetet tartalmaz stringgel tr vissza, vagy hamissal, ha gz van.
Returns a string containing the error message, false on failure.
A hibrl rszletes lerst valsznleg nem sikerl kapnod ezzel a
<function>pg_errormessage</function> fggvnnyel, ha egy hiba trtnt a legutols adatbzismvelet sorn, amely szmra ltezik egy rvnyes kapcsolat, ez a fggvny a backend server ltal generlt zenetet rja ki.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-exec">
<refnamediv>
<refname>pg_Exec</refname>
<refpurpose>vgrehajt egy krst</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_exec</methodname>
<methodparam><type>int</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
</methodsynopsis>
<para>
Egy eredmnyindexszel tr vissza, ha a krs teljesthet, vagy hamissal, ha a
kapcsolat-azonost rvnytelen, vagy nem teljesthet a krs.
A hibra vonatkoz rszleteket a
<function>pg_ErrorMessage</function> fggvny segtsgvel
nyerhetnk, ha a kapcsolat ltezik.
Egy SQL krst kld a kapcsolat-azonostban meghatrozott
PostgreSQL adatbzisnak. A kapcsolat-azonostnak egy vals
<function>pg_Connect</function> ltal visszaadott azonostnak
kell lennie. E fggvny visszatrsi rtke indexl szolgl ms
PostgreSQL fggvnyek segtsgvel trtn informcielrshez.
<note>
<simpara>
A PHP/FI 1-gyel trt vissza, ha a krs nem szolgltatott adatot.
(pl.: insert vagy update) s 1-nl nagyobb szmot olyan selecteknl
is, ami res halmazzal trt vissza.
No such assumption can be made in PHP. [Nincs ilyen felttelezs a PHP-ben???]
</simpara>
</note>
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fetch-array">
<refnamediv>
<refname>pg_Fetch_Array</refname>
<refpurpose>beolvas egy sort egy tmbbe</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>array</type><methodname>pg_fetch_array</methodname>
<methodparam><type>int</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>row</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
</methodsynopsis>
<para>
Az adatbzis kvetkez sorval tr vissza tmb formban, vagy hamissal,
ha mr nincs tbb sor.
</para>
<para>
A <function>pg_fetch_array</function> fggvny a
<function>pg_fetch_row</function> kiterjesztett vltozata.
Amellett, hogy a tmb numerikusan indexelhet, az adatokat asszociatv
indexszel is trolja a mezneveket hasznlva kulcsnak.
</para>
<para>
A harmadik, <parameter>result_type</parameter> nev argumentum a kvetkez
rtkeket veheti fel: PGSQL_ASSOC, PGSQL_NUM, and PGSQL_BOTH.
<note>
<para>
A <parameter>result_type</parameter> paramter a PHP 4.0-s
vltozatban kerlt a nyelvbe.
</para>
</note>
</para>
<para>
J tudni, hogy a
<function>pg_fetch_array</function> hasznlata NEM jelentsen lassabb,
mint a <function>pg_fetch_row</function> hasznlata, mg az eredmny rthetbb.
</para>
<para>
Tovbbi rszletekrt lsd mg a
<function>pg_fetch_row</function>
fggvnyt.
</para>
<example>
<title>A pg_fetch_array hasznlata</title>
<programlisting role="php">
<?php
$conn = pg_pconnect("","","","","publisher");
if (!$conn) {
echo "Hiba trtnt.\n";
exit;
}
$result = pg_Exec ($conn, "SELECT * FROM authors");
if (!$result) {
echo "Hiba trtnt.\n";
exit;
}
$arr = pg_fetch_array ($result, 0);
echo $arr[0] . " <- array\n"; #hiba < kell!!!
$arr = pg_fetch_array ($result, 1);
echo $arr["author"] . " <- array\n"; # itt is
?>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.pg-fetch-object">
<refnamediv>
<refname>pg_Fetch_Object</refname>
<refpurpose>sor beolvassa objektumknt</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>object</type><methodname>pg_fetch_object</methodname>
<methodparam><type>int</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>row</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
</methodsynopsis>
<para>
Egy objektummal tr vissza, aminek a tulajdonsgai megegyeznek a beolvasott
sor mezivel, hamissal, ha nincs tbb sor.
</para>
<para>
<function>pg_fetch_object</function> hasonl a
<function>pg_fetch_array</function>-hoz, egy klnbsget kivve -
objektummal tr vissza, nem tmbbel. Vagyis adatot csak meznevekkel rhetsz
el, indexszel (szmokkal) nem (a szmok ugyanis illeglis meznevek).
</para>
<para>
A harmadik, <parameter>result_type</parameter> nev argumentum a kvetkez
rtkeket veheti fel: PGSQL_ASSOC, PGSQL_NUM, and PGSQL_BOTH.
<note>
<para>
A <parameter>result_type</parameter> paramter a PHP 4.0-s
vltozatban kerlt a nyelvbe.
</para>
</note>
</para>
<para>
Sebessg szempontjbl, a fggvny azonos a
<function>pg_fetch_array</function> fggvnnyel, s majdnem olyan gyors, mint a
<function>pg_fetch_row</function> (a klnbsg jelentktelen).
</para>
<para>
Lsd mg a <function>pg_fetch_array</function> s a
<function>pg_fetch_row</function> fggvnyeket.
<example>
<title>pg_fetch_object alkalmazsa</title>
<programlisting role="php">
<?php
$database = "verlag";
$db_conn = pg_connect ("localhost", "5432", "", "", $database);
if (!$db_conn): ?>
<H1>Nem lehet kapcsoldni a <? echo $database ?> nev adatbzishoz.</H1> <?
exit;
endif;
$qu = pg_exec ($db_conn, "SELECT * FROM verlag ORDER BY autor");
$row = 0; // A postgresnek kell egy sorszmll, ami ms adatbziskezelnl taln nem
while ($data = pg_fetch_object ($qu, $row)):
echo $data->autor." (";
echo $data->jahr ."): ";
echo $data->titel."<BR>";
$row++;
endwhile; ?>
<PRE><?php
$fields[] = Array ("autor", "Author");
$fields[] = Array ("jahr", " Year");
$fields[] = Array ("titel", " Title");
$row= 0; // A postgresnek kell egy sorszmll, ami ms adatbziskezelnl taln nem
while ($data = pg_fetch_object ($qu, $row)):
echo "----------\n";
reset ($fields);
while (list (,$item) = each ($fields)):
echo $item[1].": ".$data->$item[0]."\n";
endwhile;
$row++;
endwhile;
echo "----------\n"; ?>
</PRE> <?php
pg_freeResult ($qu);
pg_close ($db_conn);
?>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fetch-row">
<refnamediv>
<refname>pg_Fetch_Row</refname>
<refpurpose>kvetkez sor beolvassa numerikusan indexelt tmbbe</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>array</type><methodname>pg_fetch_row</methodname>
<methodparam><type>int</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>row</parameter></methodparam>
</methodsynopsis>
<para>
A beolvasott sorral tr vissza numerikusan indexelt (hagyomnyos)
tmb formjban, vagy hamissal, ha nincs tbb sor.
</para>
<para>
A <function>pg_fetch_row</function> fggvny betlti a megadott
eredmny-azonostnak megfelel sort. Az eredmnyt eredmny formban
adja vissza. Az egyes oszlopokat indexszel (szmmal) lehet elrni.
Az els oszlop indexe 0.
</para>
<para>
A <function>pg_fetch_row</function> egyms utni alkalmazsval az
eredmnyhalmaz kvetkez sort kapjuk, amg van kvetkez sor, majd
hamist, ha mr nincs tbb sor.
</para>
<para>
Lsd mg a <function>pg_fetch_array</function>,
<function>pg_fetch_object</function> s a
<function>pg_result</function> fggvnyeket.
<example>
<title>pg_fetch_row alkalmazs</title>
<programlisting role="php">
<?php
$conn = pg_pconnect("","","","","publisher");
if (!$conn) {
echo "Gz van.\n";
exit;
}
$result = pg_Exec ($conn, "SELECT * FROM authors");
if (!$result) {
echo "Baj van, nagy baj van.\n";
exit;
}
$row = pg_fetch_row ($result, 0);
echo $row[0] . " <- row\n"; # < helyett valami ms kell
$row = pg_fetch_row ($result, 1);
echo $row[0] . " <- row\n"; # itt is
$row = pg_fetch_row ($result, 2);
echo $row[1] . " <- row\n"; # detto
?>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fieldisnull">
<refnamediv>
<refname>pg_FieldIsNull</refname>
<refpurpose>Megvizsglja, hogy egy mez NULL-e</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_fieldisnull</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>int</type><parameter>row</parameter></methodparam>
<methodparam><type>mixed</type><parameter>field</parameter></methodparam>
</methodsynopsis>
<para>
Megviszglja, hogy egy adott sorban az adott mez NULL-e, vagy sem.
0-t ad vissza, ha a mez nem NULL, 1-et, ha NULL. A mez szmmal,
vagy meznvvel adhat meg. A sorok szmozsa 0-val kezddik.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fieldname">
<refnamediv>
<refname>pg_FieldName</refname>
<refpurpose>Egy mez nevt mondja meg</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_fieldname</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>int</type><parameter>field_number</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_FieldName</function> fggvny az adott eredmnyazonost
s oszlopszm alapjn megmondja az oszlop nevt. Az oszlopszmozs
0-val kezddik.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fieldnum">
<refnamediv>
<refname>pg_FieldNum</refname>
<refpurpose>Adott mez oszlopszmt mondja meg</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_fieldnum</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>string</type><parameter>field_name</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_FieldNum</function> fggvny adott eredmny-azonostj
eredmny adott nev oszlopnak a sorszmt adja vissza. A sorszmozs
0-tl indul. Hiba esetn -1-gyel tr vissza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fieldprtlen">
<refnamediv>
<refname>pg_FieldPrtLen</refname>
<refpurpose>Nyomtatott hosszal tr vissza</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_fieldprtlen</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
<methodparam><type>string</type><parameter>field_name</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_FieldPrtLen</function> fggvny egy eredmny adott
sornak, adott mezejnek nyomtatott hosszt (hny darab karakter)
adja vissza. A sorok szmozsa 0-val kezddik. A fggvny -1-gyel
tr vissza hiba esetn.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fieldsize">
<refnamediv>
<refname>pg_FieldSize</refname>
<refpurpose>
Adott mez bels trolsi mrett adja
</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_fieldsize</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>int</type><parameter>field_number</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_FieldSize</function> az adott eredmny adott mezejnek
bels trolsi mrett (byteban) adja vissza. A mezk szmozsa 0-val
kezddik. A -1 hossz mez vltoz hosszsg mezt jelent. A fggvny
hiba esetn hamisat ad vissza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-fieldtype">
<refnamediv>
<refname>pg_FieldType</refname>
<refpurpose>
Az adott mez tpust adja vissza
</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_fieldtype</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>int</type><parameter>field_number</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_FieldType</function> fggvny az adott azonostj
eredmnyhalmaz adott mezejnek tpust ler stringgel tr vissza.
A mezk szmozsa 0-tl indul.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-freeresult">
<refnamediv>
<refname>pg_FreeResult</refname>
<refpurpose>Adatbzishoz kapcsold memria felszabadtsa</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_freeresult</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_FreeResult</function> fggvnyt csak akkor kell
meghvnod, ha flsz attl, hogy tl sok memrit hasznl a
scripted, mg fut. Az sszes felhasznlt memria automatikusan
felszabadul, amikor a script futsa vget r. Azonban, ha
biztos vagy benne, hogy az eredny mr nem fog kelleni,
meghvhatod a
<function>pg_FreeResult</function> fggvnyt az eredmny-azonostval,
s az eredmnyhalmazhoz tartalmaz memria felszabadul.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-getlastoid">
<refnamediv>
<refname>pg_GetLastOid</refname>
<refpurpose>Az utols objektumazonostt adja</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_getlastoid</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_GetLastOid</function> fggvny egy
<function>pg_Exec</function>-kel vgrehajtott SQL INSERT-hez
rendelt Oid (Object identifier - objektum azonost) visszanyersre
hasznlhat. Ez a fggvny pozitv egsszel tr vissza, ha egy vals
Oid-rl van sz. Ha hiba trtnt, vagy az utols mvelet, amit a
<function>pg_Exec</function>-kel vgeztek nem INSERT, a fggvny -1-gyel
tr vissza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-host">
<refnamediv>
<refname>pg_Host</refname>
<refpurpose>A hostnevet adja vissza</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_host</methodname>
<methodparam><type>int</type><parameter>connection_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_Host</function> fggvny az adott kapcsolat-azonostj
PostgreSQL host nevt adja vissza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-loclose">
<refnamediv>
<refname>pg_loclose</refname>
<refpurpose>Bezr egy nagy objektumot</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>void</type><methodname>pg_loclose</methodname>
<methodparam><type>int</type><parameter>fd</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_loclose</function> bezr egy Inversion Large
Object-et. Az <parameter>fd</parameter> paramter a
<function>pg_loopen</function>-bl szrmaz nagy objektum lerja.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-locreate">
<refnamediv>
<refname>pg_locreate</refname>
<refpurpose>ltrehoz egy nagy objektumot</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_locreate</methodname>
<methodparam><type>int</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_locreate</function> ltrehoz egy
Inversion Large Object-et s a nagy objektum oid-jvel tr vissza.
A <parameter>conn</parameter> paramter hatrozza meg a kapcsolat
azonostjt. A PostgreSQL hozzfrsi mdok: INV_READ, INV_WRITE, s
INV_ARCHIVE nem tmokatottak, az objektum mindig rsi s olvassi
joggal kerlnek ltrehozsra. Az INV_ARCHIVE pedig el lett tvoltva
a nyelvbl (a 6.3-as verzitl).
</para>
</refsect1>
</refentry>
<refentry id="function.pg-loexport">
<refnamediv>
<refname>pg_loexport</refname>
<refpurpose>Nagy objektumot file-ba exportl</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>bool</type><methodname>pg_loexport</methodname>
<methodparam><type>int</type><parameter>oid</parameter></methodparam>
<methodparam><type>int</type><parameter>file</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>connection_id</parameter></methodparam>
</methodsynopsis>
<para>
Az <parameter>oid</parameter> argumentum hatrozza meg az exportland
objektum azonostjt, s a <parameter>filename</parameter> argumentum
hatrozza meg a file tvonalt s nevt. FALSE-szal tr vissza hiba esetn,
egybknt TRUE-val. Ne feledd, hogy a PostgreSQL-ben nagy objektumokat
csak tranzakcikon bell lehet kezelni.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-loimport">
<refnamediv>
<refname>pg_loimport</refname>
<refpurpose>nagy objektumot importl filebl</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_loimport</methodname>
<methodparam><type>int</type><parameter>file</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>connection_id</parameter></methodparam>
</methodsynopsis>
<para>
A <parameter>filename</parameter> paramter hatrozal meg az importland
file tvonalt s nevt. FALSE-szal tr vissza, ha hiba trtnt,
az ppen most ltrehozott objektum azonostjval, ha a mvelet sikerlt.
Ne feledd, hogy a PostgreSQL-ben nagy objektumokat
csak tranzakcikon bell lehet kezelni.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-loopen">
<refnamediv>
<refname>pg_loopen</refname>
<refpurpose>megnyit egy nagy objektumot</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_loopen</methodname>
<methodparam><type>int</type><parameter>conn</parameter></methodparam>
<methodparam><type>int</type><parameter>objoid</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_loopen</function> megnyit egy Inversion Large Object-et
s a nagy objektum file lerjval tr vissza. A file lerban informci
van a kapcsolatrl. Ne zrd le a kapcsolatot, mg le nem zrod a nagy objektum
file lerjt.
Az <parameter>objoid</parameter> paramter egy vals nagy objektum oid-jt
hatrozza meg, s a <parameter>mode</parameter> paramter lehet
"r", "w", vagy "rw".
</para>
</refsect1>
</refentry>
<refentry id="function.pg-loread">
<refnamediv>
<refname>pg_loread</refname>
<refpurpose>nagy objektumot olvas be</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_loread</methodname>
<methodparam><type>int</type><parameter>fd</parameter></methodparam>
<methodparam><type>int</type><parameter>len</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_loread</function> beolvas legfeljebb
<parameter>len</parameter> byte-ot olvas be a nagy objektumbl,
s stringknt adja vissza.
Az <parameter>fd</parameter> paramter a file lert hatrozza meg
s a <parameter>len</parameter> ##parameter eltt hinyzik egy space
paramter hatrozza meg a maximlis
megengedett nagy objektum szegmens mrett.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-loreadall">
<refnamediv>
<refname>pg_loreadall</refname>
<refpurpose>egy egsz nagy objektumot olvas be</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>void</type><methodname>pg_loreadall</methodname>
<methodparam><type>int</type><parameter>fd</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_loreadall</function> fgvny egy nagy objektumot olvas
be, s kzvetlenl kirja a bngszbe, miutn minden szksges
fejlcet kirt. Fleg binris jelleg adat kirsra szntk. (pl.: kpek, hang)
</para>
</refsect1>
</refentry>
<refentry id="function.pg-lounlink">
<refnamediv>
<refname>pg_lounlink</refname>
<refpurpose>trl egy nagy objektumot</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>void</type><methodname>pg_lounlink</methodname>
<methodparam><type>int</type><parameter>conn</parameter></methodparam>
<methodparam><type>int</type><parameter>lobjid</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_lounlink</function> fggvny trli a
<parameter>lobjid</parameter>-vel azonostott nagy objektumot.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-lowrite">
<refnamediv>
<refname>pg_lowrite</refname>
<refpurpose>nagy objektumot r</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_lowrite</methodname>
<methodparam><type>int</type><parameter>fd</parameter></methodparam>
<methodparam><type>string</type><parameter>buf</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_lowrite</function> fggvny kir egy nagy objektumba
egy vltozbl maximum <parameter>buf</parameter> bytetot, s a
tnylegesen kirt byteok szmval tr vissza, vagy false-szal, ha hiba trtnt.
Az <parameter>fd</parameter> paramter a nagy objektum
<function>pg_loopen</function> hvsbl szrmaz file azonost.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-numfields">
<refnamediv>
<refname>pg_NumFields</refname>
<refpurpose>Mezk szma</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_numfields</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_NumFields</function> fggvny a PostgreSQL eredmnyben
lev mezk (oszlopok) szmt adja vissza. Az argumentumnak vals,
<function>pg_Exec</function>-bl szrmaz eredmny-azonostnak kell
lennie. A fggvny hiba esetn -1-gyel tr vissza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-numrows">
<refnamediv>
<refname>pg_NumRows</refname>
<refpurpose>Sorok szma</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_numrows</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_NumRows</function> fggvny a PostgreSQL eredmnyhalmaz
sorainak szmt adja vissza. Az argumentumnak vals,
<function>pg_Exec</function>-bl szrmaz eredmny-azonostnak kell
lennie. A fggvny hiba esetn -1-gyel tr vissza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-options">
<refnamediv>
<refname>pg_Options</refname>
<refpurpose>Returns options</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_options</methodname>
<methodparam><type>int</type><parameter>connection_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_Options</function> fggvny egy stringgel tr vissza,
amiben az adott PostgreSQL azonost kapcsolat opciit tartalmazza.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-pconnect">
<refnamediv>
<refname>pg_pConnect</refname>
<refpurpose>
Tarts adatbzis-kapcsolatot hoz ltre
</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_pconnect</methodname>
<methodparam><type>string</type><parameter>host</parameter></methodparam>
<methodparam><type>string</type><parameter>port</parameter></methodparam>
<methodparam><type>string</type><parameter>options</parameter></methodparam>
<methodparam><type>string</type><parameter>tty</parameter></methodparam>
<methodparam><type>string</type><parameter>dbname</parameter></methodparam>
</methodsynopsis>
<para>
Siker esetn egy kapcsolat-indexszel tr vissza, vagy hamissal,
ha a kapcsolat nem hozhat ltre. Tarts kapcsolatot nyit a
PostgreSQL adatbzishoz. Minden paramternek idzjelezettnek
kell lennie, belertve a portszmot. Az options s a tty paramterek
elhagyhatk. A fggvny egy olyan kapcsolat-azonostval tr vissza,
amely szksges ms PostgreSQL fggvnyek vgrehajtshoz.
Egyszerre tbb tarts kapcsolatod is lehet nyitva egyszerre. [Ht igen,
ez a Postgres mg a vals letet is tlszrnyalja...]
Lsd mg a <function>pg_Connect</function> fggvnyt.
</para>
<para>
Kapcsolat a kvetkez mdon is ltrehozhat:
<command>$conn = pg_pconnect("dbname=marliese port=5432");</command>
Egyb paramterek <parameter>dbname</parameter> s
<parameter>port</parameter> are[???] <parameter>host</parameter>,
<parameter>tty</parameter>, <parameter>options</parameter>,
<parameter>user</parameter> s <parameter>password</parameter>.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-port">
<refnamediv>
<refname>pg_Port</refname>
<refpurpose>Melyik porton van a kapcsolat</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>int</type><methodname>pg_port</methodname>
<methodparam><type>int</type><parameter>connection_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_Port</function> fggvny az adott PostgreSQL kapcsolat-azonostj
sszekttets portszmt adja meg.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-result">
<refnamediv>
<refname>pg_Result</refname>
<refpurpose>Egy erednyazonost alapjn ad vissza rtkeket</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>mixed</type><methodname>pg_result</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
<methodparam><type>mixed</type><parameter>fieldname</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_Result</function> fggvny a <function>pg_Exec</function>-bl
szrmaz rtkeket szolgltat.
A <parameter>row_number</parameter> s a
<parameter>fieldname</parameter> paramterek hatrozzk meg, hogy az
eredmny mely oszlopt adja vissza a fggvny. A sorok szmozsa 0-val
kezddik. A mezk megnevezse helyett a mezk sorszmt is hasznlhatjuk.
Ekkor szmknt kell megadni az oszlopszmot (nem idzjelben). A mezk szmozsa
is 0-val kezddik.
</para>
<para>
A PostgreSQL-nek nagyon sok beptett tpusa van, s csak a legalapvetbbekre
van tmogats. Az integerek, booleanok, s oid-ek minden fajtja egszknt
addik vissza. A floatok, realek pedig double-knt jelennek meg.
Minden egyb tpus, belertve a tmbket is, formzott stringknt addnak vissza.
A stringek ugyanolyan formban adja vissza, mint azt a <command>psql</command>
program [az alaprtelmezett PostgreSQL program].
</para>
</refsect1>
</refentry>
<refentry id="function.pg-trace">
<refnamediv>
<refname>pg_trace</refname>
<refpurpose>PostgreSQL szerver kapcsolatot kvet nyomon</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>bool</type><methodname>pg_trace</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
Engedlyezi a PostgreSQL fellet kommunikciinak nyomkvetst egy
fileba. Ahhoz, hogy megrtsd az eredmnyeket, meg kell bartkoznod
a PostgreSQL kommunikcis protokolljval.
Ha nem ismeret a protokollt, hasznos lehet akkor is nyomon kvetni
a szerverhez kldtt krsek hibit; pldul
'grep '^To backend' trace.log' paranccsal megnzni, hogy milyen krseket
kldtek a PostgreSQL szervernek.
</para>
<para>
A <parameter>filename</parameter> s a <parameter>mode</parameter> paramterek
azonosak a <function>fopen</function> fggvnyhez
(a <parameter>mode</parameter> alaprtelmezse 'w'),
<parameter>connection</parameter> hatrozza meg a nyomon kvetend
kapcsolatot; az utoljra megnyitot kapcsolat az alaprtelmezett.
</para>
<para>
TRUE-val tr vissza, ha a <parameter>filename</parameter> paramterben
megadott filet meg lehet nyitni loggolsra, egybknt FALSE-szal tr vissza.
</para>
<para>
Lsd mg a <function>fopen</function> s a <function>pg_untrace</function>
fggvnyeket.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-tty">
<refnamediv>
<refname>pg_tty</refname>
<refpurpose>A tty nevt adja vissza</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>string</type><methodname>pg_tty</methodname>
<methodparam><type>int</type><parameter>connection_id</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_tty</function> fggvny a tty nevt adja vissza, amelyre
az adott azonostj kapcsolat
szerver oldali nyomkvetsnek kimenete kerl.
</para>
</refsect1>
</refentry>
<refentry id="function.pg-untrace">
<refnamediv>
<refname>pg_untrace</refname>
<refpurpose>Abbahagyja az adott kapcsolat nyomkvetst</refpurpose>
</refnamediv>
<refsect1>
<title>Lers</title>
<methodsynopsis>
<type>bool</type><methodname>pg_untrace</methodname>
<methodparam choice="opt"><type>int</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
A <function>pg_trace</function> ltal elindtott nyomkvetst sznteti meg.
A <parameter>connection</parameter> paramter hatrozza meg, hogy mely
kapcsolat nyomkvetst kell abbahagyni. Az alaprtelmezs az utoljra
megnyitott kapcsolat.
</para>
<para>
Mindig TRUE-val tr vissza.
</para>
<para>
Lsd mg a <function>pg_trace</function> fggvnyt.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|