pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Extending outfuncs support to utility statements
Date: Thu, 22 Sep 2022 12:48:47 -0400
Message-ID: <1418391.1663865327@sss.pgh.pa.us> (raw)
In-Reply-To: <1415326.1663863390@sss.pgh.pa.us>
References: <4159834.1657405226@sss.pgh.pa.us>
	<9b197806-17ee-acba-0e70-01263aa46e79@enterprisedb.com>
	<1972439.1657665506@sss.pgh.pa.us>
	<2e7adbce-2ff5-866e-8753-9969b0ce332b@enterprisedb.com>
	<20220922153257.r5wj74prdqrucnov@awork3.anarazel.de>
	<1415326.1663863390@sss.pgh.pa.us>

I wrote:
> I think this is the issue Peter mentioned about needing to distinguish
> between empty strings and NULL strings.  We're going to need to rethink
> the behavior of pg_strtok() a bit to fix that.

After staring at the code a bit, I think we don't need to touch
pg_strtok() per se.  I propose that this can be resolved with changes
at the next higher level.  Let's make outToken print NULL as <> as
it always has, but print an empty string as "" (two double quotes).
If the raw input string is two double quotes, print it as \"" to
disambiguate.  This'd require a catversion bump when committed,
but I don't think there are any showstopper problems otherwise.

I'll work on fleshing that idea out.

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <1418391.1663865327@sss.pgh.pa.us>
Permalink:  ../1418391.1663865327@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1418391.1663865327@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
  Subject: Re: Extending outfuncs support to utility statements
  In-Reply-To: <1418391.1663865327@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox