• Guest
HabraHabr
  • Main
  • Users

  • Development
    • Programming
    • Information Security
    • Website development
    • JavaScript
    • Game development
    • Open source
    • Developed for Android
    • Machine learning
    • Abnormal programming
    • Java
    • Python
    • Development of mobile applications
    • Analysis and design of systems
    • .NET
    • Mathematics
    • Algorithms
    • C#
    • System Programming
    • C++
    • C
    • Go
    • PHP
    • Reverse engineering
    • Assembler
    • Development under Linux
    • Big Data
    • Rust
    • Cryptography
    • Entertaining problems
    • Testing of IT systems
    • Testing Web Services
    • HTML
    • Programming microcontrollers
    • API
    • High performance
    • Developed for iOS
    • CSS
    • Industrial Programming
    • Development under Windows
    • Image processing
    • Compilers
    • FPGA
    • Professional literature
    • OpenStreetMap
    • Google Chrome
    • Data Mining
    • PostgreSQL
    • Development of robotics
    • Visualization of data
    • Angular
    • ReactJS
    • Search technologies
    • Debugging
    • Test mobile applications
    • Browsers
    • Designing and refactoring
    • IT Standards
    • Solidity
    • Node.JS
    • Git
    • LaTeX
    • SQL
    • Haskell
    • Unreal Engine
    • Unity3D
    • Development for the Internet of things
    • Functional Programming
    • Amazon Web Services
    • Google Cloud Platform
    • Development under AR and VR
    • Assembly systems
    • Version control systems
    • Kotlin
    • R
    • CAD/CAM
    • Customer Optimization
    • Development of communication systems
    • Microsoft Azure
    • Perfect code
    • Atlassian
    • Visual Studio
    • NoSQL
    • Yii
    • Mono и Moonlight
    • Parallel Programming
    • Asterisk
    • Yandex API
    • WordPress
    • Sports programming
    • Lua
    • Microsoft SQL Server
    • Payment systems
    • TypeScript
    • Scala
    • Google API
    • Development of data transmission systems
    • XML
    • Regular expressions
    • Development under Tizen
    • Swift
    • MySQL
    • Geoinformation services
    • Global Positioning Systems
    • Qt
    • Dart
    • Django
    • Development for Office 365
    • Erlang/OTP
    • GPGPU
    • Eclipse
    • Maps API
    • Testing games
    • Browser Extensions
    • 1C-Bitrix
    • Development under e-commerce
    • Xamarin
    • Xcode
    • Development under Windows Phone
    • Semantics
    • CMS
    • VueJS
    • GitHub
    • Open data
    • Sphinx
    • Ruby on Rails
    • Ruby
    • Symfony
    • Drupal
    • Messaging Systems
    • CTF
    • SaaS / S+S
    • SharePoint
    • jQuery
    • Puppet
    • Firefox
    • Elm
    • MODX
    • Billing systems
    • Graphical shells
    • Kodobred
    • MongoDB
    • SCADA
    • Hadoop
    • Gradle
    • Clojure
    • F#
    • CoffeeScript
    • Matlab
    • Phalcon
    • Development under Sailfish OS
    • Magento
    • Elixir/Phoenix
    • Microsoft Edge
    • Layout of letters
    • Development for OS X
    • Forth
    • Smalltalk
    • Julia
    • Laravel
    • WebGL
    • Meteor.JS
    • Firebird/Interbase
    • SQLite
    • D
    • Mesh-networks
    • I2P
    • Derby.js
    • Emacs
    • Development under Bada
    • Mercurial
    • UML Design
    • Objective C
    • Fortran
    • Cocoa
    • Cobol
    • Apache Flex
    • Action Script
    • Joomla
    • IIS
    • Twitter API
    • Vkontakte API
    • Facebook API
    • Microsoft Access
    • PDF
    • Prolog
    • GTK+
    • LabVIEW
    • Brainfuck
    • Cubrid
    • Canvas
    • Doctrine ORM
    • Google App Engine
    • Twisted
    • XSLT
    • TDD
    • Small Basic
    • Kohana
    • Development for Java ME
    • LiveStreet
    • MooTools
    • Adobe Flash
    • GreaseMonkey
    • INFOLUST
    • Groovy & Grails
    • Lisp
    • Delphi
    • Zend Framework
    • ExtJS / Sencha Library
    • Internet Explorer
    • CodeIgniter
    • Silverlight
    • Google Web Toolkit
    • CakePHP
    • Safari
    • Opera
    • Microformats
    • Ajax
    • VIM
  • Administration
    • System administration
    • IT Infrastructure
    • *nix
    • Network technologies
    • DevOps
    • Server Administration
    • Cloud computing
    • Configuring Linux
    • Wireless technologies
    • Virtualization
    • Hosting
    • Data storage
    • Decentralized networks
    • Database Administration
    • Data Warehousing
    • Communication standards
    • PowerShell
    • Backup
    • Cisco
    • Nginx
    • Antivirus protection
    • DNS
    • Server Optimization
    • Data recovery
    • Apache
    • Spam and antispam
    • Data Compression
    • SAN
    • IPv6
    • Fidonet
    • IPTV
    • Shells
    • Administering domain names
  • Design
    • Interfaces
    • Web design
    • Working with sound
    • Usability
    • Graphic design
    • Design Games
    • Mobile App Design
    • Working with 3D-graphics
    • Typography
    • Working with video
    • Work with vector graphics
    • Accessibility
    • Prototyping
    • CGI (graphics)
    • Computer Animation
    • Working with icons
  • Control
    • Careers in the IT industry
    • Project management
    • Development Management
    • Personnel Management
    • Product Management
    • Start-up development
    • Managing the community
    • Service Desk
    • GTD
    • IT Terminology
    • Agile
    • Business Models
    • Legislation and IT-business
    • Sales management
    • CRM-systems
    • Product localization
    • ECM / EDS
    • Freelance
    • Venture investments
    • ERP-systems
    • Help Desk Software
    • Media management
    • Patenting
    • E-commerce management
    • Creative Commons
  • Marketing
    • Conferences
    • Promotion of games
    • Internet Marketing
    • Search Engine Optimization
    • Web Analytics
    • Monetize Web services
    • Content marketing
    • Monetization of IT systems
    • Monetize mobile apps
    • Mobile App Analytics
    • Growth Hacking
    • Branding
    • Monetize Games
    • Display ads
    • Contextual advertising
    • Increase Conversion Rate
  • Sundry
    • Reading room
    • Educational process in IT
    • Research and forecasts in IT
    • Finance in IT
    • Hakatonas
    • IT emigration
    • Education abroad
    • Lumber room
    • I'm on my way

Syntax Highlight PostgreSQL

 3r33333. 3r3-31. I hasten to share the good news: the life of the authors of articles on PostgreSQL and their readers has become a little better. 3r33333.  3r33333. 3r33333.  3r33333. As all habropolisters know, a special 3r-3261 tag is used to format the source code.
which highlights the syntax. It is also no secret that the backlighting does not always turn out to be ideal, and then the authors (who cares how their articles look) are forced to engage in amateur performances — color their code with the help of 3r-3261.
. 3r33333.  3r33333. 3r33333.  3r33333. Everything was especially sad with PostgreSQL, since the backlight covered more or less standard SQL and categorically did not understand the specifics of our DBMS. As time went by, Alexey boomburum diligently fixed my fonts on the source (and I back) until it became obvious that the backlight had to be repaired. Finally Daler daleraliyorov prompted the exit: add PostgreSQL support to the library. highlight which Habr uses. And now - ready, welcome. 3r33333.  3r33333.
3r3305. 3r33333.  3r33333.

pgsql: SQL, PL /pgSQL and all

3r33333.  3r33333. So, the secret of the right lighting - in the new language 3r33214. pgsql
. You can select it in the menu (“source code” button) or specify it manually. In html for this you need to write
 3r33333. 3r33333.  3r33333. 3r33333.  3r33333. my code is 3r33333.  3r33333. 3r33333.  3r33333. 3r33333.  3r33333. and in markdown - like this:
 3r33333. 3r33333.  3r33333. `` `pgsql
 3r33333. my code is 3r33333.  3r33333. `` `
 3r33333.
3r33333.  3r33333. In principle, highlightjs can determine the language itself, but normally it works only for large code fragments; on small pieces, autodetection often misses. In addition, autodetection takes time, so if you specify the language explicitly, the code will quickly play with colors. 3r33333.  3r33333. 3r33333.  3r33333. For example, to get
 3r33333. 3r33333.  3r33333.
    CREATE TABLE aircrafts_data (3r33333. Aircraft_code character (3) NOT NULL,
Model jsonb NOT NULL,
Range integer NOT NULL,
CONSTRAINT aircrafts_range_check CHECK ((range> 0)) 333333333333333 3r33333.
3r33333.  3r33333. we write
 3r33333. 3r33333.  3r33333. 3r33333.  3r33333. CREATE TABLE aircrafts_data (
 3r33333. aircraft_code character (3) NOT NULL,
 3r33333. model jsonb NOT NULL,
 3r33333. range integer NOT NULL,
 3r33333. CONSTRAINT aircrafts_range_check CHECK ((range> 0))
 3r33333. ); 3r33333.  3r33333. 3r33333.  3r33333.
3r33333.  3r33333. The same pgsql language also colors PL /pgSQL code. For example, to get
 3r33333. 3r33333.  3r33333.
    CREATE FUNCTION get_available_flightid (date) RETURNS SETOF integer AS $$
BEGIN
RETURN QUERY
SELECT flightid FROM flight WHERE flightdate> = $ 1 AND flightdate < ($1 + 1);
IF NOT FOUND THEN
RAISE EXCEPTION 'There are no flights to date:%.', $ 1; 3r33333. END IF; 3r33333. RETURN; 3r33333. END
$$ LANGUAGE plpgsql; 3r33333.
3r33333.  3r33333. we write
 3r33333. 3r33333.  3r33333. 3r33333.  3r33333. CREATE FUNCTION get_available_flightid (date) RETURNS SETOF integer AS $$
 3r33333.
 3r33333. $$ LANGUAGE plpgsql; 3r33333.  3r33333. 3r33333.  3r33333.
3r33333.  3r33333. The subtlety is that the character strings are enclosed in dollars, 3r3303. Always 3r3306. highlighted as code, and the lines in the apostrophes are not highlighted 3r3303. never . I considered different options, but this one seemed to be the most adequate. 3r33333.  3r33333. 3r33333.  3r33333. The ability of highlightjs to automatically determine the language of a fragment allows highlighting functions in other languages. For example, everything will work for PL /Perl:
 3r33333. 3r33333.  3r33333.
    CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$
my ($ x, $ y) = @_; 3r33333. if (not defined $ x) {3r3333318. return undef if not defined $ y; 3r33333. return $ y; 3r33333.}
return $ x if not defined $ y; 3r33333. return $ x if $ x> $ y; 3r33333. return $ y; 3r33333. $$ LANGUAGE plperl; 3r33333.
3r33333.  3r33333. To do this, you do not need anything special, just write
 3r33333. 3r33333.  3r33333. 3r33333.  3r33333. CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$
 3r33333.
 3r33333. $$ LANGUAGE plperl; 3r33333.  3r33333. 3r33333.  3r33333.
3r33333.  3r33333. Of course, the chosen language depends only on what is written inside the dollars, and is in no way determined by what is written after LANGUAGE. 3r33333.  3r33333. 3r33333.  3r33333. In general, the backlight corresponds to the recently released 11th version of PostgreSQL. 3r33333.  3r33333. 3r33333.  3r33333. There were many doubts about the highlighting of functions. Unfortunately, to distinguish the name of a function from, for example, the name of a table, a full-fledged syntactic analysis is needed, and this is not solved within the framework of syntax highlighting. You can make a long list of standard functions and color them, but what about the functions of the numerous extensions? As a result, I decided not to color at all - all the same, everything rests on the keywords, but the variegation diminished. 3r33333.  3r33333. 3r33333.  3r33333.

plaintext: text, just text

3r33333.  3r33333. Sometimes the article is required to issue the results of the query. Of course, there are no keywords there, you don't need to highlight anything, but I want the text to look “console”, just like code. For this, you can now use the special language plaintext . For example, to get
 3r33333. 3r33333.  3r33333.
    WITH xmldata (data) AS (VALUES ($$
3r33232.
3r33318. 3r31818. $ Xxxx) 3r SELECT xmltable. *
FROM XMLTABLE (XMLNAMESPACES ('http://example.com/myns' AS x,
'Http://example.com/b' AS "B"),
'/X: example /x: item'
PASSING (SELECT data FROM xmldata)
COLUMNS foo int PATH '@foo',
Bar int PATH '@B: bar'); 3r33333.
3r33333.  3r33333.
    foo | bar
----- + -----
1 | 2
3 | 4
4 | 5
(3 rows)
3r33333.  3r33333. we write
 3r33333. 3r33333.  3r33333. 3r33333.  3r33333. WITH xmldata (data) AS (VALUES ($$
 3r33333.
 3r33333. 3r33333.  3r33333. 3r33333.  3r33333. foo | bar
 3r33333. ----- + -----
 3r33333. 1 | 2
 3r33333. 3 | 4
 3r33333. 4 | 5
 3r33333. (3 rows)
 3r33333. 3r33333.  3r33333.
3r33333.  3r33333. Plaintext should always be specified explicitly, it is not automatically detected. 3r33333.  3r33333. 3r33333.  3r33333. I hope that the innovation you enjoy and come in handy. If you find an error in how the code is highlighted (and errors are inevitable, too context-sensitive syntax in SQL), create a task for 3r39797. github project
, and even better - offer a solution. 3r33333.  3r33333. 3r33333.  3r33333. 3r3303. P. S. Do not forget about the conference 3r3304. PGConf 3r3305. to be held February 4-6 in Moscow. Applications for reports are accepted until December 5! 3r3306.
3r33333. 3r33333. 3r33333. 3r33311. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r33312. 3r33333.
3r33333. 3r33333. 3r33333. 3r33333.

It may be interesting

  • Comments
  • About article
  • Similar news
This publication has no comments.

weber

Author

22-11-2018, 07:18

Publication Date

Development / PostgreSQL

Category
  • Comments: 0
  • Views: 311
SHOCK! New software for phishing does
Let's talk about metrics as a way to
“How to turn a simple project into a
Rome Club Report 201? Chapter 1.5: The
Egocentric daffodils are inferior in
Notes IoT provider. Case: we make a
Write a comment
Name:*
E-Mail:


Comments
The Daily Reports is the reliable and authentic news and blog publisher. Visit The Daily Reports for up-to-date US news, international news and policy analysis. Check out: International Politics News
Today, 17:28

saifwordpress

nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this!  https://l23movies.club/
Today, 15:35

Legend SEO

Extremely helpful post. This is my first time i visit here. I discovered such a large number of intriguing stuff in your blog particularly its exchange. Truly its extraordinary article. Keep it up.먹튀검증사이트

Today, 14:34

raymond weber

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.  pigmentvlekken verwijderen - dermasensation.nl
Today, 14:25

jacksonseo

Bangalore Escorts provides escort call girls by the escort agency in Bangalore. We have selected the best high profile call girls in Bangalore. Visit us www.piyagupta.com/
South Bangalore  Escorts || Marathahalli Escorts || Electronic City Escorts || Hebbal Escorts || Mg road Escorts || Ulsoor Escorts || Ub city Escorts || Nandi hills Escorts || Malleswaram Escorts || Commercial street  Escorts || Indira nagar Escorts || Hsr layout Escorts

Today, 12:24

piyagupta01

Adv
Website for web developers. New scripts, best ideas, programming tips. How to write a script for you here, we have a lot of information about various programming languages. You are a webmaster or a beginner programmer, it does not matter, useful articles will help to make your favorite business faster.

Login

Registration Forgot password