pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Naveen Dabas <naveen@paymonk.com>
To: Paul Carlucci <paul.carlucci@gmail.com>
Cc: Abhinav Mehta <abhinav@metarain.com>
Cc: Ravi Krishna <sravikrishna@aol.com>
Cc: pgsql-general@postgresql.org
Subject: Re: pg_sample
Date: Mon, 27 Aug 2018 07:12:09 -0700
Message-ID: <489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com> (raw)
In-Reply-To: <CA+YHAKHvyVG2y5C1ag48GqzD3ssZ9EGfC5tWQPOxhr17_YE1eA@mail.gmail.com>
References: <CAJNY3is_pe4p5JLg6rXCzbtqTwePjETjXMc2VZ3+WCNwhM4JFA@mail.gmail.com>
	<1535008237286-0.post@n3.nabble.com>
	<4c4a06f8-ac5d-97db-3095-34034141abb4@aklaver.com>
	<CA+YHAKHJSEr22+q4aX71Rb+p9Kv1ucFNKektgLAcSDqtiKkjcg@mail.gmail.com>
	<7188ecc6-fced-74b2-b573-0917a9eb615a@aklaver.com>
	<CA+YHAKHnt0W=wDr+jZJZX=oM_mZoS7N+6JGnfEpM8cXx7ChREg@mail.gmail.com>
	<E399D99D-1184-4B0E-A34F-0AC901E40D8E@aol.com>
	<1B39DEAA-2C07-4B89-A39C-081CCD1A82C8@metarain.com>
	<CA+YHAKHY=tWKH54B_0eQRuZ5VGNcJsiWTkwTN_8XvcqNbFMgVw@mail.gmail.com>
	<CAKhGwmB=fQRTSRFaOXtvDOni-msGCZBJ6Vu3Y00k7riMTCBRxw@mail.gmail.com>
	<CA+YHAKGTxq6wQ_XUGNgvFLt-iQhbD5KvFNkftbdh97mQT7mh+g@mail.gmail.com>
	<CA+YHAKHvyVG2y5C1ag48GqzD3ssZ9EGfC5tWQPOxhr17_YE1eA@mail.gmail.com>

On 08/26/2018 11:03 PM, Naveen Dabas wrote:
> Server encoding is UTF8
> Client encoding is UTF8
> Creating sample schema sampledb1
> DBD::Pg::db do failed: ERROR:  cannot execute CREATE SCHEMA in a 
> read-only transaction at ./pg_sample line 296.
> main::__ANON__('DBD::Pg::db do failed: ERROR:  cannot execute CREATE 
> SCHEMA i...', 'DBI::db=HASH(0xab2388)', undef) called at ./pg_sample 
> line 478
> Done.
> 
> 
> can you help me in this

Yes, by suggesting you try something other then pg_sample. The last 
commit was 4 years ago and it does not seem to be up to date enough.

What sort of sampling do you want to do?

> thanks
> 
> On Mon, Aug 27, 2018 at 11:16 AM, Naveen Dabas <naveen@paymonk.com 
> <mailto:naveen@paymonk.com>> wrote:
> 
>     Thanks for the help.
>     But now i'm getting some different error as i rum this command
>     ./pg_sample -a -f file.sql --limit="user = 100" --schema=dbname -h
>     hostname -U user -W password
> 
>     I am not getting output and one file opens , in that file there id
>     guide for pg_sample
>     ----
>     /tmp/9REOT5C
> 
>     NAME
>     pg_sample - extract a small, sample dataset from a larger PostgreSQL
>     database while maintaining referential integrity.
>     =head1 SYNOPSIS
>     pg_sample [ option... ] [ dbname ]
>     =head1 DESCRIPTION
>     pg_sample is a utility for exporting a small, sample dataset from a
>     larger PostgreSQL database. The output and command-line options closely
>     resemble the pg_dump backup utility (although only the plain-text format
>     is supported).
>     The sample database produced includes all tables from the original,
>     maintains referential integrity, and supports circular dependencies.
>     To build an actual instance of the sample database, the output of
>     this script
>     can be piped to the psql utility. For example, assuming we have an
>     existing
>     PostgreSQL database named "mydb", a sample database could be
>     constructed with:
>        createdb sampledb
>        pg_sample mydb | psql sampledb
>     and so on .......
> 
>     On Mon, Aug 27, 2018 at 1:27 AM, Paul Carlucci
>     <paul.carlucci@gmail.com <mailto:paul.carlucci@gmail.com>> wrote:
> 
>         sudo yum install perl-CPAN
> 
>         Also do a "yum search perl-" and you should find most, if not
>         all what you need natively packaged for your particular Linux
>         distro.  You're better off just sticking with the pre-packaged
>         perl modules unless you specifically need something special.
> 
>         You'll find more modules if you also enable the EPEL yum repo by
>         setting enabled=1 in the first section of
>         /etc/yum.repos.d/epel.conf and rerunning that yum search command.
> 
>         On Sun, Aug 26, 2018, 2:20 PM Naveen Dabas <naveen@paymonk.com
>         <mailto:naveen@paymonk.com>> wrote:
> 
>             Sir i'm getting error in both commands
> 
>             [root@ip-88-8-8-17 ~]#  perl -MCPAN -e 'install Bundle::DBI'
>             Can't locate CPAN.pm in @INC (@INC contains:
>             /usr/local/lib64/perl5 /usr/local/share/perl5
>             /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
>             /usr/lib64/perl5 /usr/share/perl5 .).
>             BEGIN failed--compilation aborted.
>             [root@ip-88-8-8-17 ~]# perl -MCPAN -e 'install DBD::Pg'
>             Can't locate CPAN.pm in @INC (@INC contains:
>             /usr/local/lib64/perl5 /usr/local/share/perl5
>             /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
>             /usr/lib64/perl5 /usr/share/perl5 .).
>             BEGIN failed--compilation aborted.
> 
> 
> 
>             operating system =CentOS Linux release 7.5.1804 (Core)
> 
>             thanks
> 
> 
>             On Fri, Aug 24, 2018 at 6:16 PM, Abhinav Mehta
>             <abhinav@metarain.com <mailto:abhinav@metarain.com>> wrote:
> 
>                 Solution, execute this on your linux terminal -
> 
>                 $ perl -MCPAN -e 'install Bundle::DBI'
>                 $ perl -MCPAN -e 'install DBD::Pg'
> 
>                  > On 24-Aug-2018, at 6:13 PM, Ravi Krishna
>                 <sravikrishna@aol.com <mailto:sravikrishna@aol.com>> wrote:
>                  >
>                  >>
>                  >> sir have taken pg_sample
>                  >> Now i want to run pg_sample with credential but i'm
>                 getting this error
>                  >>
>                  >> Can't locate DBI.pm in @INC (@INC contains:
>                 /usr/local/lib64/perl5 /usr/local/share/perl5
>                 /usr/lib64/perl5/vendor_perl
>                 /usr/share/perl5/vendor_perl /usr/lib64/perl5
>                 /usr/share/perl5 .) at ./pg_sample line 192.
>                  >> BEGIN failed--compilation aborted at ./pg_sample
>                 line 192.
>                  >
>                  > As is clear from the message, you need to install
>                 Perl DBI/DBD first.
>                  >
>                  >
> 
> 
> 
> 
>             -- 
>             --
>             With Regards
>             Naveen Dabas
>             Ph. 9017298370
> 
> 
>             *Important Disclaimer:* Information contained in this email
>             is for the recipient primarily addressed to. If you are not
>             the primary recipient or are not supposed to receive this
>             email, you are advised to kindly delete the email or the
>             thread and notify of the error. The logo is a registered and
>             copyrighted property of *ACTAS TECHNOLOGIES PRIVATE
>             LIMITED*. Do not use it without authorization.
> 
> 
> 
> 
>     -- 
>     --
>     With Regards
>     Naveen Dabas
>     Ph. 9017298370
> 
> 
> 
> 
> -- 
> --
> With Regards
> Naveen Dabas
> Ph. 9017298370
> 
> 
> *Important Disclaimer:* Information contained in this email is for the 
> recipient primarily addressed to. If you are not the primary recipient 
> or are not supposed to receive this email, you are advised to kindly 
> delete the email or the thread and notify of the error. The logo is a 
> registered and copyrighted property of *ACTAS TECHNOLOGIES PRIVATE 
> LIMITED*. Do not use it without authorization.


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (25+ messages)  latest in thread

Message-ID: <489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com>
Permalink:  ../489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com/
Also on:    postgresql.org/message-id/489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, naveen@paymonk.com, paul.carlucci@gmail.com, abhinav@metarain.com, sravikrishna@aol.com
  Subject: Re: pg_sample
  In-Reply-To: <489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com>
  References: <CAJNY3is_pe4p5JLg6rXCzbtqTwePjETjXMc2VZ3+WCNwhM4JFA@mail.gmail.com> <1535008237286-0.post@n3.nabble.com> <4c4a06f8-ac5d-97db-3095-34034141abb4@aklaver.com> <CA+YHAKHJSEr22+q4aX71Rb+p9Kv1ucFNKektgLAcSDqtiKkjcg@mail.gmail.com> <7188ecc6-fced-74b2-b573-0917a9eb615a@aklaver.com> <CA+YHAKHnt0W=wDr+jZJZX=oM_mZoS7N+6JGnfEpM8cXx7ChREg@mail.gmail.com> <E399D99D-1184-4B0E-A34F-0AC901E40D8E@aol.com> <1B39DEAA-2C07-4B89-A39C-081CCD1A82C8@metarain.com> <CA+YHAKHY=tWKH54B_0eQRuZ5VGNcJsiWTkwTN_8XvcqNbFMgVw@mail.gmail.com> <CAKhGwmB=fQRTSRFaOXtvDOni-msGCZBJ6Vu3Y00k7riMTCBRxw@mail.gmail.com> <CA+YHAKGTxq6wQ_XUGNgvFLt-iQhbD5KvFNkftbdh97mQT7mh+g@mail.gmail.com> <CA+YHAKHvyVG2y5C1ag48GqzD3ssZ9EGfC5tWQPOxhr17_YE1eA@mail.gmail.com> <489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com>

* 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