A Pen by develost.com on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Execute select in pgAdmin | |
# write result to file | |
""" | |
select encode(my_bin_field,'base64') | |
from my_schema.my_table | |
where id=123; | |
""" | |
# Remove column name from generated file | |
import base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------------- | |
--- Bulk alter table owner for all tables in multiple schema | |
--- to be run into pgAdmin "Execute pgScript" | |
--------------------------------------------------------------------------------- | |
--- hint: replace MY_USER with your actual user | |
SET @elements = select schemaname, tablename from pg_tables where schemaname in ('public','test','whatever'); | |
SET @i = 0; | |
WHILE @i < LINES(@elements) | |
BEGIN |
keyframes animation of a steam engine (css)
A Pen by develost.com on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS manager.get_remote_select(text, text, text, text[], text); | |
CREATE OR REPLACE FUNCTION manager.get_remote_select(dblink_name text,remote_schema_name text,remote_table_name text, remote_attribute_names text[], where_clause text) | |
RETURNS text AS | |
$BODY$ | |
DECLARE | |
information_schema_query text; | |
information_schema_record record; | |
remote_attribute_name text; | |
remote_attribute_types text[] := '{}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create type typ_number_table IS TABLE OF NUMBER; | |
declare | |
ptyp_list typ_number_table; | |
begin | |
ptyp_list := typ_number_table(); | |
ptyp_list.extend; | |
ptyp_list(ptyp_list.last) := 88; | |
ptyp_list.extend; | |
ptyp_list(ptyp_list.last) := 90; |