From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Surafel Temesgen <surafel3000(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: proposal: possibility to read dumped table's name from file |
Date: | 2021-09-17 12:16:15 |
Message-ID: | CAFj8pRDkEg8d5-++ZZfqS7w4U074WamLPfuosx259jAHTVJBbw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
pá 17. 9. 2021 v 14:07 odesílatel Daniel Gustafsson <daniel(at)yesql(dot)se>
napsal:
> > On 17 Sep 2021, at 13:59, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> > pá 17. 9. 2021 v 13:56 odesílatel Daniel Gustafsson <daniel(at)yesql(dot)se
> <mailto:daniel(at)yesql(dot)se>> napsal:
> > > On 17 Sep 2021, at 13:51, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com
> <mailto:pavel(dot)stehule(at)gmail(dot)com>> wrote:
> > > pá 17. 9. 2021 v 13:42 odesílatel Daniel Gustafsson <daniel(at)yesql(dot)se
> <mailto:daniel(at)yesql(dot)se> <mailto:daniel(at)yesql(dot)se <mailto:daniel(at)yesql(dot)se>>>
> napsal:
>
> > > I am unable to write a filter statement which can
> > > handle this relname:
> > >
> > > CREATE TABLE "a""
> > > ""b" (a integer);
> > >
> > > Are you able to craft one for that?
> > >
> > > I am not able to dump this directly in pg_dump. Is it possible?
> >
> > Sure, see below:
> >
> > $ ./bin/psql filter
> > psql (15devel)
> > Type "help" for help.
> >
> > I didn't ask on this
> >
> > I asked if you can use -t and some for filtering this name?
>
> I didn't try as I don't see how that's relevant? Surely we're not
> limiting the
> capabilities of a filtering file format based on the quoting semantics of a
> shell?
>
this patch just use existing functionality, that can be buggy too.
but I had a bug in this part - if I detect double double quotes on input I
have to send double quotes to output too.
It should be fixed in attached patch
[pavel(at)localhost pg_dump]$ echo 'include table "a""\n""b"' | ./pg_dump
--filter=-
--
-- PostgreSQL database dump
--
-- Dumped from database version 15devel
-- Dumped by pg_dump version 15devel
> --
> Daniel Gustafsson https://vmware.com/
>
>
Attachment | Content-Type | Size |
---|---|---|
pg_dump-filteropt-20210917.patch | text/x-patch | 17.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2021-09-17 13:06:51 | Re: proposal: possibility to read dumped table's name from file |
Previous Message | vignesh C | 2021-09-17 12:12:32 | Re: Added schema level support for publication. |