Code Monkey home page Code Monkey logo

Comments (5)

gmp042 avatar gmp042 commented on July 22, 2024 1

Hi, Jerome. Thanks for your time!

from pynonymizer.

gmp042 avatar gmp042 commented on July 22, 2024

I'm using version 1.20.0

from pynonymizer.

rwnx avatar rwnx commented on July 22, 2024

Hi, I think we need a little more information to diagnose the issue - what is the table actually called? and can you give me an example what you think that query should be ?

I'm a little confused by the output since in the query, it looks like the table name is already in uppercase.

from pynonymizer.

gmp042 avatar gmp042 commented on July 22, 2024

Hi Jerome,

I did some research and found this answer in StackOverflow:

Identifiers (including column names) that are not double-quoted are folded to lower case in PostgreSQL. Column names that were created with double-quotes and thereby retained upper-case letters (and/or other syntax violations) have to be double-quoted for the rest of their life

So I tried the query as it is and the relation was folded to lowercase.

strategy3_75721d1a2a054d33bebd27eb5e2ee9ae=# UPDATE APP AS "updatetarget" SET "APP_NAME" = ( SELECT company FROM _pynonymizer_seed_fake_data ORDER BY RANDOM(), MD5("updatetarget"::text) LIMIT 1),"CLIENT_ID" = ( SELECT md5 FROM _pynonymizer_seed_fake_data ORDER BY RANDOM(), MD5("updatetarget"::text) LIMIT 1),"CLIENT_SECRET" = ( SELECT md5 FROM _pynonymizer_seed_fake_data ORDER BY RANDOM(), MD5("updatetarget"::text) LIMIT 1);']
ERROR:  relation "app" does not exist
LINE 1: UPDATE APP AS "updatetarget" SET "APP_NAME" = ( SELEC...
strategy3_75721d1a2a054d33bebd27eb5e2ee9ae'#

After double-quoting table's name, the query ran successfully.

strategy3_75721d1a2a054d33bebd27eb5e2ee9ae'# UPDATE "APP" AS "updatetarget" SET "APP_NAME" = ( SELECT company FROM _pynonymizer_seed_fake_data ORDER BY RANDOM(), MD5("updatetarget"::text) LIMIT 1),"CLIENT_ID" = ( SELECT md5 FROM _pynonymizer_seed_fake_data ORDER BY RANDOM(), MD5("updatetarget"::text) LIMIT 1),"CLIENT_SECRET" = ( SELECT md5 FROM _pynonymizer_seed_fake_data ORDER BY RANDOM(), MD5("updatetarget"::text) LIMIT 1);']
strategy3_75721d1a2a054d33bebd27eb5e2ee9ae'#

Is it possible to always double-quote table's name as has been done for columns?

from pynonymizer.

rwnx avatar rwnx commented on July 22, 2024

Hi, thanks for looking into that! Yeah, this seems like a good fix. I can pull together a PR later this week, or i'm happy to look at PRs if you're down 😇

from pynonymizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.