← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~tushar5526/launchpad:use-escape-string-syntax into launchpad:master

 


Diff comments:

> diff --git a/database/schema/patch-2211-46-0.sql b/database/schema/patch-2211-46-0.sql
> new file mode 100644
> index 0000000..b7e32ea
> --- /dev/null
> +++ b/database/schema/patch-2211-46-0.sql
> @@ -0,0 +1,15 @@
> +-- Copyright 2025 Canonical Ltd.  This software is licensed under the
> +-- GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +SET client_min_messages=ERROR;
> +
> +-- StructuralSubscription
> +COMMENT ON COLUMN StructuralSubscription.product IS E'The subscription\'s target, when it is a product.';

Thanks, I wasn't aware about the double quoting method. I will use that. 

For @ines, I am using E here primarily because in future I will be setting "standard_conforming_strings" to true in our DB, which defaults to treating backslashes (\) as literal strings instead of escape sequences. As in this case, we want PG to treat the backslash as an escape sequence, I added an E here. 

Right now, with "standard_conforming_string" set to false, the behaviour is to treat backslashes as escape sequences. 

Using "E" gurantees, that we get the same behaviour irrespective of whether the "standard_conforming_strings" is set or not. 

                       scs = on                                scs = off
 'Hello \nWorld'    Hello \nWorld                    Hello (actual new line) World    
E'Hello \nWorld'    Hello (actual new line) World    Hello (actual new line) World

> +COMMENT ON COLUMN StructuralSubscription.productseries IS E'The subscription\'s target, when it is a product series.';
> +COMMENT ON COLUMN StructuralSubscription.project IS E'The subscription\'s target, when it is a project.';
> +COMMENT ON COLUMN StructuralSubscription.milestone IS E'The subscription\'s target, when it is a milestone.';
> +COMMENT ON COLUMN StructuralSubscription.distribution IS E'The subscription\'s target, when it is a distribution.';
> +COMMENT ON COLUMN StructuralSubscription.distroseries IS E'The subscription\'s target, when it is a distribution series.';
> +COMMENT ON COLUMN StructuralSubscription.sourcepackagename IS E'The subscription\'s target, when it is a source-package';

ack, will fix that.

> +
> +INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 46, 0);


-- 
https://code.launchpad.net/~tushar5526/launchpad/+git/launchpad/+merge/493109
Your team Launchpad code reviewers is requested to review the proposed merge of ~tushar5526/launchpad:use-escape-string-syntax into launchpad:master.



References