75
33.7.2.3. Passing Query Parameters Using an SQLDA..............................778
33.7.2.4. A Sample Application Using SQLDA ........................................779
33.8. Error Handling......................................................................................................784
33.8.1. Setting Callbacks .....................................................................................784
33.8.2. sqlca .........................................................................................................786
33.8.3.
SQLSTATE
vs.
SQLCODE
...........................................................................788
33.9. Preprocessor Directives........................................................................................791
33.9.1. Including Files .........................................................................................791
33.9.2. The define and undef Directives ..............................................................792
33.9.3. ifdef, ifndef, else, elif, and endif Directives.............................................792
33.10. Processing Embedded SQL Programs................................................................793
33.11. Library Functions ...............................................................................................794
33.12. Large Objects......................................................................................................795
33.13. C++ Applications ...............................................................................................796
33.13.1. Scope for Host Variables........................................................................797
33.13.2. C++ Application Development with External C Module......................798
33.14. Embedded SQL Commands...............................................................................800
ALLOCATE DESCRIPTOR ...............................................................................800
CONNECT...........................................................................................................802
DEALLOCATE DESCRIPTOR..........................................................................805
DECLARE...........................................................................................................806
DESCRIBE..........................................................................................................808
DISCONNECT....................................................................................................809
EXECUTE IMMEDIATE....................................................................................811
GET DESCRIPTOR ............................................................................................812
OPEN...................................................................................................................815
PREPARE ............................................................................................................817
SET AUTOCOMMIT ..........................................................................................818
SET CONNECTION...........................................................................................819
SET DESCRIPTOR.............................................................................................820
TYPE....................................................................................................................822
VAR......................................................................................................................824
WHENEVER.......................................................................................................825
33.15. Informix Compatibility Mode ............................................................................827
33.15.1. Additional Types....................................................................................827
33.15.2. Additional/Missing Embedded SQL Statements...................................827
33.15.3. Informix-compatible SQLDA Descriptor Areas....................................828
33.15.4. Additional Functions..............................................................................831
33.15.5. Additional Constants..............................................................................839
33.16. Internals..............................................................................................................840
34. The Information Schema...................................................................................................843
34.1. The Schema..........................................................................................................843
34.2. Data Types............................................................................................................843
34.3.
information_schema_catalog_name
...........................................................844
34.4.
administrable_role_authorizations
.......................................................844
34.5.
applicable_roles
............................................................................................844
34.6.
attributes
.........................................................................................................845
34.7.
character_sets
................................................................................................849
34.8.
check_constraint_routine_usage
.............................................................850
34.9.
check_constraints
.........................................................................................850
34.10.
collations
.......................................................................................................851
34.11.
collation_character_set_applicability
............................................851
xviii
157
34.12.
column_domain_usage
...................................................................................852
34.13.
column_options
..............................................................................................852
34.14.
column_privileges
.......................................................................................853
34.15.
column_udt_usage
..........................................................................................853
34.16.
columns
.............................................................................................................854
34.17.
constraint_column_usage
..........................................................................859
34.18.
constraint_table_usage
.............................................................................860
34.19.
data_type_privileges
.................................................................................860
34.20.
domain_constraints
.....................................................................................861
34.21.
domain_udt_usage
..........................................................................................862
34.22.
domains
.............................................................................................................862
34.23.
element_types
................................................................................................865
34.24.
enabled_roles
................................................................................................868
34.25.
foreign_data_wrapper_options
................................................................869
34.26.
foreign_data_wrappers
...............................................................................869
34.27.
foreign_server_options
.............................................................................869
34.28.
foreign_servers
............................................................................................870
34.29.
foreign_table_options
...............................................................................870
34.30.
foreign_tables
..............................................................................................871
34.31.
key_column_usage
..........................................................................................871
34.32.
parameters
.......................................................................................................872
34.33.
referential_constraints
..........................................................................875
34.34.
role_column_grants
.....................................................................................876
34.35.
role_routine_grants
...................................................................................876
34.36.
role_table_grants
.......................................................................................877
34.37.
role_udt_grants
............................................................................................878
34.38.
role_usage_grants
.......................................................................................879
34.39.
routine_privileges
.....................................................................................879
34.40.
routines
...........................................................................................................880
34.41.
schemata
...........................................................................................................886
34.42.
sequences
.........................................................................................................886
34.43.
sql_features
..................................................................................................888
34.44.
sql_implementation_info
..........................................................................888
34.45.
sql_languages
................................................................................................889
34.46.
sql_packages
..................................................................................................890
34.47.
sql_parts
.........................................................................................................890
34.48.
sql_sizing
.......................................................................................................891
34.49.
sql_sizing_profiles
...................................................................................891
34.50.
table_constraints
.......................................................................................892
34.51.
table_privileges
..........................................................................................892
34.52.
tables
...............................................................................................................893
34.53.
triggered_update_columns
........................................................................894
34.54.
triggers
...........................................................................................................895
34.55.
udt_privileges
..............................................................................................896
34.56.
usage_privileges
..........................................................................................897
34.57.
user_defined_types
.....................................................................................898
34.58.
user_mapping_options
.................................................................................899
34.59.
user_mappings
................................................................................................900
34.60.
view_column_usage
.......................................................................................900
34.61.
view_routine_usage
.....................................................................................901
34.62.
view_table_usage
..........................................................................................902
34.63.
views
.................................................................................................................902
xix
60
V. Server Programming.................................................................................................................904
35. Extending SQL..................................................................................................................906
35.1. How Extensibility Works......................................................................................906
35.2. The PostgreSQL Type System..............................................................................906
35.2.1. Base Types ...............................................................................................906
35.2.2. Composite Types......................................................................................906
35.2.3. Domains...................................................................................................907
35.2.4. Pseudo-Types...........................................................................................907
35.2.5. Polymorphic Types ..................................................................................907
35.3. User-defined Functions.........................................................................................908
35.4. Query Language (SQL) Functions .......................................................................908
35.4.1. Arguments for SQL Functions.................................................................909
35.4.2. SQL Functions on Base Types.................................................................910
35.4.3. SQL Functions on Composite Types .......................................................912
35.4.4. SQL Functions with Output Parameters..................................................915
35.4.5. SQL Functions with Variable Numbers of Arguments............................916
35.4.6. SQL Functions with Default Values for Arguments................................917
35.4.7. SQL Functions as Table Sources .............................................................917
35.4.8. SQL Functions ReturningSets ................................................................918
35.4.9. SQL Functions Returning
TABLE
............................................................920
35.4.10. Polymorphic SQL Functions .................................................................921
35.4.11. SQL Functions with Collations..............................................................922
35.5. Function Overloading...........................................................................................923
35.6. Function Volatility Categories..............................................................................924
35.7. Procedural Language Functions...........................................................................925
35.8. Internal Functions.................................................................................................925
35.9. C-Language Functions..........................................................................................926
35.9.1. Dynamic Loading.....................................................................................926
35.9.2. Base Types in C-Language Functions......................................................927
35.9.3. Version 0 Calling Conventions ................................................................930
35.9.4. Version 1 Calling Conventions ................................................................932
35.9.5. Writing Code............................................................................................935
35.9.6. Compiling and Linking Dynamically-loaded Functions..........................936
35.9.7. Composite-type Arguments.....................................................................938
35.9.8. Returning Rows (Composite Types) ........................................................939
35.9.9. Returning Sets..........................................................................................941
35.9.10. Polymorphic Arguments and Return Types...........................................946
35.9.11. Transform Functions..............................................................................947
35.9.12. Shared Memory and LWLocks ..............................................................948
35.9.13. Using C++ for Extensibility...................................................................948
35.10. User-defined Aggregates ....................................................................................949
35.10.1. Moving-Aggregate Mode.......................................................................950
35.10.2. Polymorphic and Variadic Aggregates...................................................952
35.10.3. Ordered-Set Aggregates.........................................................................953
35.10.4. Support Functions for Aggregates.........................................................954
35.11. User-defined Types.............................................................................................955
35.12. User-defined Operators.......................................................................................958
35.13. Operator Optimization Information....................................................................959
35.13.1.
COMMUTATOR
..........................................................................................959
35.13.2.
NEGATOR
................................................................................................960
35.13.3.
RESTRICT
..............................................................................................961
xx
Documents you may be interested
Documents you may be interested