Skip to content

Demo for detecting truncated Postgres identifiers in Sqitch

Notifications You must be signed in to change notification settings

ewie/sqitch-namelen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo for detecting truncated Postgres identifiers in Sqitch

    $ createdb test
    $ export SQITCH_TARGET=db:pg:test

    $ ./test.sh 63
    Deploying changes to db:pg:test
      + namelen .. ok
    Reverting all changes from db:pg:test
    Will revert the following changes:
    namelen
      - namelen .. ok

    $ echo $?
    0

    $ ./test.sh 64

    Deploying changes to db:pg:test
      + namelen .. psql:deploy/namelen.sql:5: NOTICE:  identifier "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" will be truncated to "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ok
    Reverting all changes from db:pg:test
    Will revert the following changes:
    namelen
      - namelen .. psql:revert/namelen.sql:5: NOTICE:  identifier "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" will be truncated to "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ok
    error: detected truncated identifiers, see test.log

    $ echo $?
    1

    $ cat test.log
    psql:deploy/namelen.sql:5: NOTICE:  identifier "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" will be truncated to "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    psql:revert/namelen.sql:5: NOTICE:  identifier "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" will be truncated to "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

About

Demo for detecting truncated Postgres identifiers in Sqitch

Topics

Resources

Stars

Watchers

Forks