TAIL is handled as a non-standard COPY TO statement
See original GitHub issueTrying to get node-postgres working with a streaming database that uses the postgres protocol. From the docs I cut a section and added it below. Having trouble getting it to work. Does this driver support something like cursor.copy_expert("TAIL some_materialized_view", sys.stdout)
?
In terms of the pgwire protocol, TAIL is handled as a non-standard COPY TO statement. As long as your driver lets you send your own COPY statement to the running Materialize node, you can TAIL updates from Materialize anywhere you’d like.
#!/usr/bin/env python3
import sys
import psycopg2
def main():
dsn = 'postgresql://localhost:6875/materialize?sslmode=disable'
conn = psycopg2.connect(dsn)
with conn.cursor() as cursor:
cursor.copy_expert("TAIL some_materialized_view", sys.stdout)
if __name__ == '__main__':
main()
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Linux: write tail -f output, plus comments, to a separate text file
For record purposes, I would like to be able to pipe the tail output to terminal, plus my annotations, to a second file....
Read more >20.8. Error Reporting and Logging - PostgreSQL
Unrecognized escapes are ignored. Other characters are copied straight to the log line. Some escapes are only recognized by session processes, and will...
Read more >Why does Mozilla consider Conditional catch-blocks non-standard ...
Non-standard This feature is non-standard and is not on a standards track. ... TypeError) { // statements to handle TypeError exceptions } catch...
Read more >RFC 6241: Network Configuration Protocol (NETCONF)
For example, user files and databases are not treated as configuration ... A NETCONF message MAY begin with an XML declaration (see Section...
Read more >Comparison of different SQL implementations - Troels
DB2 allows you to copy the structure of a view into a table. ... Due to Oracle's non-standard NULL-handling, you may get strange...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The pg-query-stream README referencespg.connect
, but it’s out of date. You should connect a client as shown at https://node-postgres.com/features/connecting/. The query stream might work then.@vitaly-t “cursor” in the Python code refers to a PEP 249 cursor, not a PostgreSQL cursor.I was thinking of pg-copy-streams, not pg-query-stream. pg-query-stream is a wrapper for pg-cursor. You want pg-copy-streams.
Ill try this out and report back