Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifP9j-0000nq-8S for pgsql-admin@arkaria.postgresql.org; Thu, 12 Dec 2019 14:09:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ifP8j-00048I-5C for pgsql-admin@arkaria.postgresql.org; Thu, 12 Dec 2019 14:08:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifP8i-00048A-NO for pgsql-admin@lists.postgresql.org; Thu, 12 Dec 2019 14:08:24 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifP8f-0006LX-6j for pgsql-admin@lists.postgresql.org; Thu, 12 Dec 2019 14:08:24 +0000 Received: by mail-wr1-x42c.google.com with SMTP id q10so2844201wrm.11 for ; Thu, 12 Dec 2019 06:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=Ud8v98BHQnKAgBloJHkGOj6cgEg8bTXvgsuiqy+TPeU=; b=VKip11+xHQMn6B+7KiubIsBPfHSUTfZ/MyhsSc+ymAI9Bq1Lb/qUsIpQTl8NZFjK5o Np029V5loxWpTeI3TjS+75bU1yA4lCfAEZdDL0HsgDU0Hec9+9LLhtGQ0gVDy43CxzeT vojck1SgUtZi9p/9UL2xtuYs06lbW+oOiTFcvrl0inLSDyrXvDMjS76ht6o1qe36Clss u8mMN0fauJViJZFOB0M5iudE3oXICCJjtwM1geIxVptMPNxgJLv0TgFfp7awz6LCr5St 40b+wxYwWp87KvnDWd+do5qZBc6f1dHwKPafyHViIwD5rPrC5qQb582yxs2E5Q/aefdG iE7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Ud8v98BHQnKAgBloJHkGOj6cgEg8bTXvgsuiqy+TPeU=; b=Gxa0HhbynaDf6UyPhb4qpCIQBJx+mTbOSwlbSIblHMRVmk6+J4BTAuS9N/6znHiDZM n8ImjjgBjmyNrnF+61aPJoVZPTMwrwkjBf+V/dKRQEvriQ1JI/jeptf0eqHrcxX+1G/v 2Pw+pTCozCpB70qn8dHJKIOxC0gCN73YcpVvxTlG9CfLuhka0Q9zFYu84jsGBMpN7BK9 E9Auxm86AK4W92gLNb47bPKpwWIIG2+PZ7pjm4FrSRMTWRhbod/frcx9mqJGTdC7f8jj YE74QvmEGaVHfY7aYgLw92KTGXPzGujS0SdcQ8RvK71tlcNqJQP7rF8wl074WkFwInXY Xnqg== X-Gm-Message-State: APjAAAVirgAYG8lHtrt/pB/la3fJWx0brrYVqepXmQeu9QHB/EBraifq WK4MyVAOi+7ErPevSx/hSAuuII4GEak= X-Google-Smtp-Source: APXvYqxOj3tbF1kiIxHdGNVJaPuNXkWnUdIpgPfU28q/ebSWJtT8V7yB04jCU2scvPg+fjBhLVwmXA== X-Received: by 2002:adf:eb09:: with SMTP id s9mr6816843wrn.61.1576159698983; Thu, 12 Dec 2019 06:08:18 -0800 (PST) Received: from localhost.localdomain ([192.166.195.178]) by smtp.gmail.com with ESMTPSA id b17sm6180966wrx.15.2019.12.12.06.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 06:08:18 -0800 (PST) Message-ID: Subject: Re: Insert hex / octal literals in a query? From: Laurenz Albe To: "S.Bob" , pgsql-admin@lists.postgresql.org Date: Thu, 12 Dec 2019 15:08:16 +0100 In-Reply-To: <676b031e-ac08-36f4-8253-c5cb266404d7@quadratum-braccas.com> References: <676b031e-ac08-36f4-8253-c5cb266404d7@quadratum-braccas.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2019-12-11 at 21:07 -0700, S.Bob wrote: > we have a client that needs us to pull data via sql and stage it in a > file with odd hex / octal characters as the field delimiter (Hex 1F or > Oct 31) > > Is there an easy way to do this ? No problem: COPY uni TO ... (FORMAT 'csv', DELIMITER E'\u001F') Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com