PostgreSQL Funzioni

Note

Nota:

Not all functions are supported by all builds. It depends on your libpq (The PostgreSQL C client library) version and how libpq is compiled. If PHP PostgreSQL extensions are missing, then it is because your libpq version does not support them.

Nota:

Most PostgreSQL functions accept connection as the optional first parameter. If it is not provided, the last opened connection is used. If it doesn't exist, functions return false.

Nota:

PostgreSQL automatically folds all identifiers (e.g. table/column names) to lower-case values at object creation time and at query time. To force the use of mixed or upper case identifiers, you must escape the identifier using double quotes ("").

Nota:

PostgreSQL does not have special commands for fetching database schema information (eg. all the tables in the current database). Instead, there is a standard schema named information_schema in PostgreSQL 7.4 and above containing system views with all the necessary information, in an easily queryable form. See the » PostgreSQL Documentation for full details.

Indice dei contenuti

  • pg_affected_rows — Restituisce il numero delle tuple coinvolte dall'ultimo comando
  • pg_cancel_query — Annulla una query asincrona
  • pg_client_encoding — Restituisce la codifica caratteri del client
  • pg_close — Chiude una connessione PostgreSQL
  • pg_connect_poll — Poll the status of an in-progress asynchronous PostgreSQL connection attempt
  • pg_connect — Stabilisce una connessione PostgreSQL
  • pg_connection_busy — Riferisce se una connessione è occupata o meno
  • pg_connection_reset — Rpristina la connessione (riconnette)
  • pg_connection_status — Restituisce lo stato di una connessione
  • pg_consume_input — Reads input on the connection
  • pg_convert — Converte i valori di un array associativo in una forma compatibile con i comandi SQL.
  • pg_copy_from — Inserisce le tuple in una tabella prendendole da un array
  • pg_copy_to — Copia una tabella in un array
  • pg_dbname — Restituisce il nome del database
  • pg_delete — Cancella le tuple.
  • pg_end_copy — Esegue una sincronizzazione con il backend PostgreSQL
  • pg_escape_bytea — Aggiunge le sequenze di escape ai dati binari nel tipo bytea
  • pg_escape_identifier — Escape a identifier for insertion into a text field
  • pg_escape_literal — Escape a literal for insertion into a text field
  • pg_escape_string — Aggiunge le sequenze di escape nei tipi text/char
  • pg_execute — Sends a request to execute a prepared statement with given parameters, and waits for the result
  • pg_fetch_all_columns — Fetches all rows in a particular result column as an array
  • pg_fetch_all — Carica tutte le tuple in un array
  • pg_fetch_array — Carica una tupla in un array
  • pg_fetch_assoc — Recupera una riga come array associativo
  • pg_fetch_object — Carica una tupla in un oggetto
  • pg_fetch_result — Restituisce i valori da una risorsa di risultato
  • pg_fetch_row — Carica una tupla in un array
  • pg_field_is_null — Verifica se un campo è null
  • pg_field_name — Restituisce il nome di un campo
  • pg_field_num — Restituisce la posizione del campo specificato
  • pg_field_prtlen — Restituisce la lunghezza "stampabile" di un valore
  • pg_field_size — Restituisce la reale dimensione di memorizzazione del campo
  • pg_field_table — Returns the name or oid of the tables field
  • pg_field_type_oid — Returns the type ID (OID) for the corresponding field number
  • pg_field_type — Restituisce il nome del tipo del campo specificato
  • pg_flush — Flush outbound query data on the connection
  • pg_free_result — Libera la memoria allocata per i risultati
  • pg_get_notify — Ottiene il messaggio SQL NOTIFY
  • pg_get_pid — Ottiene l'ID del processo del backend
  • pg_get_result — Recupera i risultati di una query asincrona
  • pg_host — Restituisce il nome dell'host associato alla connessione
  • pg_insert — Inserisce un array in una tabella.
  • pg_last_error — Restituisce l'ultimo messaggio d'errore di una connessione
  • pg_last_notice — Restituisce l'ultimo messaggio di notifica dal server PostgreSQL
  • pg_last_oid — Restituisce l'oid dell'ultimo oggetto
  • pg_lo_close — Chiude un large object
  • pg_lo_create — Crea un large object
  • pg_lo_export — Esporta un large object salvandolo su un file
  • pg_lo_import — Importa un large object da un file
  • pg_lo_open — Apre un large object
  • pg_lo_read_all — Legge interamente un large object e lo manda direttamente al browser
  • pg_lo_read — Legge un large object
  • pg_lo_seek — Ricerca la posizione di un large object
  • pg_lo_tell — Restituisce la posizione attuale in un large object
  • pg_lo_truncate — Truncates a large object
  • pg_lo_unlink — Cancella un large object
  • pg_lo_write — Scrive un large object
  • pg_meta_data — Ottiene la definizione di una tabella.
  • pg_num_fields — Restituisce il numero di campi
  • pg_num_rows — Restituiscein numero di tuple
  • pg_options — Estrae le opzioni associate alla connessione
  • pg_parameter_status — Looks up a current parameter setting of the server
  • pg_pconnect — Open a persistent PostgreSQL connection
  • pg_ping — Effettua il ping alla connessione del database
  • pg_port — Restituisce il numero di porta associato alla connessione
  • pg_prepare — Submits a request to create a prepared statement with the given parameters, and waits for completion
  • pg_put_line — Invia una stringa terminata da NULL al backend PostgreSQL
  • pg_query_params — Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text
  • pg_query — Esegue una query
  • pg_result_error_field — Returns an individual field of an error report
  • pg_result_error — Restituisce i messaggio di errore associato al risultato
  • pg_result_seek — Imposta l'offset di riga interno nella risorsa risultato
  • pg_result_status — Recupera lo stato del risultato di una query
  • pg_select — Seleziona delle tuple.
  • pg_send_execute — Sends a request to execute a prepared statement with given parameters, without waiting for the result(s)
  • pg_send_prepare — Sends a request to create a prepared statement with the given parameters, without waiting for completion
  • pg_send_query_params — Submits a command and separate parameters to the server without waiting for the result(s)
  • pg_send_query — Invia una query in modo asincrono
  • pg_set_client_encoding — Imposta la codifica del client
  • pg_set_error_context_visibility — Determines the visibility of the context's error messages returned by pg_last_error and pg_result_error
  • pg_set_error_verbosity — Determines the verbosity of messages returned by pg_last_error and pg_result_error
  • pg_socket — Get a read only handle to the socket underlying a PostgreSQL connection
  • pg_trace — iAbilita il tracciamento di una connessione PostgreSQL
  • pg_transaction_status — Returns the current in-transaction status of the server
  • pg_tty — Restituisce il nome della tty associata alla connessione
  • pg_unescape_bytea — Rimuove i caratteri di escape in modo binario per il tipo bytea
  • pg_untrace — Disabilita il tracciamento di una connessione PostgreSQL
  • pg_update — Modifica le tuple della tabella
  • pg_version — Returns an array with client, protocol and server version (when available)