Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fuIFd-0002vg-QQ for pgsql-general@arkaria.postgresql.org; Mon, 27 Aug 2018 14:12:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fuIFc-0006KI-9t for pgsql-general@arkaria.postgresql.org; Mon, 27 Aug 2018 14:12:16 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fuIFc-0006KB-1Z for pgsql-general@lists.postgresql.org; Mon, 27 Aug 2018 14:12:16 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fuIFZ-0004cx-3o for pgsql-general@postgresql.org; Mon, 27 Aug 2018 14:12:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E55FD2118B; Mon, 27 Aug 2018 10:12:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 27 Aug 2018 10:12:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=//6/+lk9+gu+BsumXss7RwOmk9L99 bjRtvj9H/AW3eY=; b=02a2xy+G6615R8GRhw1WGD3SHD2XPsbnuns8r1ZFYv1cH VWpJA2vg6u5vLuYNVE1xzDpBwn4InQaqQPXuFAWDETiCe6Z9FtyqqAg6twEXBaEq 8QTHUZg0MqAYmgfAdl1C+P6nO1q49he8ZoEnvRjHCo9Hqa5J5X7PoSwhxXTAj95b raWrqLmKvPeTH9LUi45i13OACMqHyV9/JEF8yIp+todnhWkQGX0TLOS+cA/8fgcz 8ny5Bacn1APCFxrxZ5GxHDv3zDWLD0qi6qXRLvRGNZDZyg31LJ9VW06qJpUBsWF1 uaniNoV4Pe/O1ggGOK0DgjRzxNsU6JsmnGx5leqnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=//6/+l k9+gu+BsumXss7RwOmk9L99bjRtvj9H/AW3eY=; b=Jun6egY+dd7ZbT0jGUuUi2 qpvYrk0o8wQWK+QmW461+2Eefoqh4okD8p6OG+wZsRR095GtmPfqgY5TX8LMieBQ 1sQcCED9WZkf3uVhAr2KhkmjmU/jRA5q5MWp/BcdM82TnPsB8uzky2w1i+TngJPJ lRJbx6k2oXgvBzprv4C9ZjYkdSJEQ+jLwtsQ/uBcp5CU8XqJNzeTo/Q7ugsagsK6 /CXqCtZbnpEe1R5xILTy4SWSeZWpx+G6hbwHogEBKaroDaHm+qSHXDV6bUs0R5Zb PVQlKC4nJwYqCWUMnwBOz89Uqu88b0tURGAI2rHYaMWNHjep/DeIy0RVpdOGxcvw == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 8C75BE465F; Mon, 27 Aug 2018 10:12:10 -0400 (EDT) Subject: Re: pg_sample To: Naveen Dabas , Paul Carlucci Cc: Abhinav Mehta , Ravi Krishna , pgsql-general@postgresql.org References: <1535008237286-0.post@n3.nabble.com> <4c4a06f8-ac5d-97db-3095-34034141abb4@aklaver.com> <7188ecc6-fced-74b2-b573-0917a9eb615a@aklaver.com> <1B39DEAA-2C07-4B89-A39C-081CCD1A82C8@metarain.com> From: Adrian Klaver Message-ID: <489060b3-d6df-18e4-8e81-a0162c490e43@aklaver.com> Date: Mon, 27 Aug 2018 07:12:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 > 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 > > 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 > 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 > > 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 > > 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