This file contains hidden or 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
(See v2) | |
Query: | |
Modify this so it's a Postgres builtin function, callable from SQL. The code should be designed to be added to ruleutils.c | |
============================================================================================================================== | |
reply: | |
I've rewritten the code to be a proper PostgreSQL builtin function that would be added to ruleutils.c. Here are the key changes and design decisions: |
This file contains hidden or 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
The query: | |
Write a C function for postgresql to return the creation DDL for a table. | |
Don't use SPI. The function should include unlogged, temporary, and partitioned tables. | |
Type names should be fetched using the get_typename_with_typemod function. | |
It should include all relevant column properties such as collation, storage and compression method, and table properties | |
such as commit behaviour, storage, and tablespace | |
========================================================================================================================================= |
This file contains hidden or 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
This is Claude's description of the code: | |
============================================================================================================================= | |
This C function creates a PostgreSQL extension function called get_table_ddl that generates the CREATE TABLE DDL for a given table without using SPI. Here's what it does: | |
Key Features: | |
Takes a table name as input (supports schema.table format) | |
Returns the complete CREATE TABLE statement as text | |
Handles column definitions with proper data types and type modifiers |
This file contains hidden or 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
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'qemu' | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. |
This file contains hidden or 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
curl --header "Authorization: Bearer <your_access_token>" https://gitlab.example.com/api/v4/projects | | |
jq -c -r '.[]|[.http_url_to_repo, .visibility]' | |
# works with private token or OAuth token |
This file contains hidden or 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
curl -H "Authorization: token $token" -s "https://api.github.com/orgs/$orgname/repos?per_page=100&page=$pagenum" | \ | |
jq -c -r '.[]|[.html_url, .private]' |
This file contains hidden or 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
perl -p -e "local \$/ = undef; my \$log = <>; \$log =~ s/('|\\\$[a-zA-Z0-9_]*\\\$)(.*)\$1/\$1 . (q[X] x length(\$2)) . \$1/gme; print \$log;" /tmp/logsamp |
This file contains hidden or 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
# appveyor.yml | |
before_build: | |
- set PATH=C:\Program Files\PostgreSQL\9.6\bin;%PATH% | |
- cmake -G "Visual Studio 14 2015 Win64" | |
- dir | |
- pg_config | |
build: | |
project: cranges.sln |
This file contains hidden or 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
# appveyor.yml | |
install: | |
- cinst winflexbison | |
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64' | |
before_build: | |
- net user testuser Blurfl9426! /add | |
- rename c:\ProgramData\chocolatey\bin\win_flex.exe flex.exe | |
- rename c:\ProgramData\chocolatey\bin\win_bison.exe bison.exe | |
- curl -S -O https://gist.githubusercontent.com/adunstan/7f18e5db33bb2d73f69ff8c9337a4e6c/raw/buildsetup.pl |
This file contains hidden or 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
@echo off | |
rem see http://stackoverflow.com/questions/9946322/how-to-generate-an-import-library-lib-file-from-a-dll#9946390 | |
rem see also http://www.postgresql-archive.org/MSVC-pl-perl-error-message-is-not-verbose-enough-td5913411.html | |
rem see also https://postgr.es/m/CABcP5fjEjgOsh097cWnQrsK9yCswo4DZxp-V47DKCH-MxY9Gig@mail.gmail.com | |
REM Usage: dll2lib [32|64] some-file.dll | |
REM | |
REM Generates some-file.lib from some-file.dll, making an intermediate |
NewerOlder