Anasayfa / Database (Sayfa 2)

Database

ubuntu server 20.04 install postgresql and remote access

sudo apt-get update sudo apt-get upgrade sudo reboot sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update sudo apt-get -y install postgresql   dikkat aşağıdaki işlem veritabanı sunucunuzu tamamen dışarıya açar bilinçli bir şekilde yaptığınızdan …

Devamını Oku »

Python Firebird Backup Restore Database

import firebirdsql.fbcore from firebirdsql import services def restore_database(fbk_file: str, fdb_file: str): con = services.connect(user='SYSDBA', password='masterkey') con.restore_database(fbk_file, fdb_file, pageSize=16384, replace=True ) def backup_database(fdb_file: str, fbk_file: str): con = services.connect(user='SYSDBA', password='masterkey') con.backup_database(fdb_file, fbk_file)  

Devamını Oku »

postgresql find dependent object

https://stackoverflow.com/questions/4462908/find-dependent-objects-for-a-table-or-view   SELECT dependent_ns.nspname as dependent_schema , dependent_view.relname as dependent_view , source_ns.nspname as source_schema , source_table.relname as source_table , pg_attribute.attname as column_name FROM pg_depend JOIN pg_rewrite ON pg_depend.objid = pg_rewrite.oid JOIN pg_class as dependent_view ON pg_rewrite.ev_class = dependent_view.oid JOIN pg_class as source_table ON pg_depend.refobjid = source_table.oid JOIN pg_attribute ON pg_depend.refobjid …

Devamını Oku »

postgresql gtip noktalı çevir

create or replace function fn_getGtipNoktali(p_gtip varchar) returns varchar language plpgsql as $$ declare temp_gtip varchar; ret_gtip varchar; begin SELECT replace(p_gtip, '.', '') into temp_gtip; select SUBSTRING ( temp_gtip ,0 , 5 )||'.'||SUBSTRING ( temp_gtip ,5 , 2 )||'.'||SUBSTRING ( temp_gtip ,7 , 2 )||'.'||SUBSTRING ( temp_gtip ,9 , 2 )||'.'||SUBSTRING …

Devamını Oku »