小编gud*_*ier的帖子

Postgresql:更改所有者对象时出错"必须是关系的所有者"

grant我需要给当前用户(" userA ")以允许他更改由另一个用户(" userC ")所属的对象所有者的选项/技巧是什么?

更确切地说,联系表由userC拥有,当我执行以下查询以将所有者更改为userB时,与userA连接:

alter table contact owner to userB;
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

ERROR:  must be owner of relation contact
Run Code Online (Sandbox Code Playgroud)

但是userA通常都需要权限(" 在模式上创建 "授权选项应该足够了):

grant select,insert,update,delete on all tables in schema public to userA; 
grant select,usage,update on all sequences in schema public to userA;
grant execute on all functions in schema public to userA;
grant references, trigger on all tables in schema public to userA;
grant create on schema public …
Run Code Online (Sandbox Code Playgroud)

postgresql grant

52
推荐指数
3
解决办法
8万
查看次数

如何将Maven groupId,artifactId和项目版本添加到命令行

我想从命令行中检索groupId,artifactId和 Maven项目的版本.

本主题中提出的解决方案" 如何将Maven项目版本添加到bash命令行 "是使用以下插件:

mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.artifactId

它的工作原理很好,但我想不出如何设置,在同一时间内,project.groupId, project.artifactId & project.version-Dexpression说法.

我会避免每次使用不同的-Dexpression参数启动3次Maven命令...

THKS


目前,我通过执行以下操作来检索数据:

local pom_groupid=`mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.groupId |grep -Ev '(^\[|Download\w+:)'`
local pom_artifactid=`mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.artifactId |grep -Ev '(^\[|Download\w+:)'`
local pom_version=`mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.version |grep -Ev '(^\[|Download\w+:)'`
Run Code Online (Sandbox Code Playgroud)

command-line maven

13
推荐指数
6
解决办法
2万
查看次数

transformResponse headers参数($ resource)中缺少自定义响应的标头

我已经定义了$resource一个API端点,它返回一个包含多个响应的响应,headers但在transformResponse配置函数中,headersGetter函数参数中缺少大多数标头.

我该如何解决?

API的响应标头

HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
x-frame-options: DENY
Access-Control-Allow-Origin: http://localhost:9000
access-control-allow-methods: POST, PUT, GET, DELETE, OPTIONS
access-control-allow-headers: Content-Type
Access-Control-Allow-Credentials: true
Content-Disposition: attachment; filename="testCall.pcap"
FileName: testCall.pcap
Content-Type: application/pcap
Run Code Online (Sandbox Code Playgroud)

transformResponse的标题

Pragma: no-cache
Content-Type: application/pcap
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Expires: 0
Run Code Online (Sandbox Code Playgroud)
app.factory("MyService", function ($resource, ENV, _) {
    return {
        testCall: $resource(ENV.apiEndpoint + "/test-call", {}, {
            launch: { …
Run Code Online (Sandbox Code Playgroud)

angularjs ngresource

7
推荐指数
1
解决办法
2821
查看次数

Liquibase:如何始终将变更集作为最后的更新操作运行

我在项目上使用Liquibase,并且每次更新Liquibase后都需要始终执行一个过程...

当前,changeSet如下所示:

<changeSet id="liquibase-0" author="liquibase" runAlways="true">
   <sqlFile relativeToChangelogFile="true" path="procedure/owner-changer.sql"/>
</changeSet>
Run Code Online (Sandbox Code Playgroud)

如何确保此changeSet将作为上一次更新操作运行?

谢谢

liquibase

6
推荐指数
2
解决办法
3596
查看次数

Maven 程序集:生成资源 zip 文件并将其包含到主程序集 zip 文件中

如何使用 Maven Assembly 插件将生成的 zip 文件包含到zip 文件中?

例如,我有以下文件夹结构:

./folderA/
./file1
Run Code Online (Sandbox Code Playgroud)

我想生成一个 zip 文件,其中的内容是这样的:

folderA.zip
file1
Run Code Online (Sandbox Code Playgroud)

这是我的简化配置':

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project >
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptor>${basedir}/assembly-zipFolderA.xml</descriptor>
                    <finalName>folderA.zip</finalName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptor>${basedir}/assembly.xml</descriptor>
                    <finalName>${module-zipFinalName}</finalName>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
Run Code Online (Sandbox Code Playgroud)

程序集zipFolderA.xml

<assembly>
    <id>folderA-zip</id>
    <includeBaseDirectory>false</includeBaseDirectory>
    <formats>
        <format>zip</format>
    </formats>

    <fileSets>
        <fileSet>
            <directory>folderA</directory>
            <outputDirectory>/</outputDirectory>
        </fileSet>
    </fileSets>
</assembly>
Run Code Online (Sandbox Code Playgroud)

程序集.xml

<assembly>
    <id>main</id>
    <includeBaseDirectory>false</includeBaseDirectory>
    <formats>
        <format>zip</format>
    </formats>

    <files>
        <file>
            <source>file1</source>
        </file>
        <file>
            <source>folderA.zip</source>
        </file>
    </files>
</assembly>
Run Code Online (Sandbox Code Playgroud)

===>使用这个配置,Maven 抱怨它找不到 …

maven maven-assembly-plugin

3
推荐指数
1
解决办法
7784
查看次数