Re: psql command failing with error "undefined symbol: PQhostaddr"

2021-12-29 Thread Narendra katlamudi
 Hey Team,
Thanks for quick responses. But yeah, seems on my system Libpq.so* files were 
not present in the usual library path. After setting LD_LIBRARY_PATH to 
consider the location about libpg.so*, the psql  command started working.
thanks,
On Tuesday, 28 December, 2021, 06:23:30 pm IST, Pavel Stehule 
 wrote:  
 
 Hi

út 28. 12. 2021 v 13:29 odesílatel Narendra katlamudi 
 napsal:

Hi Team
When I use psql to connect a pg server, I am getting below error. Any 
solution/pointers?
I have pg versions 11,12,13 installed on my system.

/usr/lib/postgresql/13/bin/psql: symbol lookup error: 
/usr/lib/postgresql/13/bin/psql: undefined symbol: PQhostaddr

Looks like a bad (too old) version of libpq library.

https://stackoverflow.com/questions/28123212/postgres-9-4-0-undefined-symbol-pqhostaddr
Regards
Pavel
 


thanks,Narendra K
  

Initial Sync - One Subscriber After The Other vs. Parallel

2021-12-29 Thread Avi Weinberg
Hi All

I'm testing logical replication and noticed that when I sync large tables to 
multiple subscribers, it is synchronizing two large tables out of 4 for 
subscriber A and then then two tables to subscriber B and continue to toggle 
between the two subscriptions.

It is possible to tell it to complete one subscription before starting the 
other?
What are the parameters that I can configure to increase the performance of 
sync and reduce its overall sync time, when one publisher is publishing to 
multiple subscriptions?

2021-12-29 02:46:06 UTC [1125]: [1-1] 61cbcbee.465 0 LOG:  logical 
replication table synchronization worker for subscription "sub_dcn", table 
"packit3" has started
2021-12-29 02:46:06 UTC [1127]: [1-1] 61cbcbee.467 0 LOG:  logical 
replication table synchronization worker for subscription "sub_dcn", table 
"packit4" has started
2021-12-29 02:46:17 UTC [1173]: [1-1] 61cbcbf9.495 0 LOG:  logical 
replication table synchronization worker for subscription "sub_gwn", table 
"packit3" has started
2021-12-29 02:46:17 UTC [1175]: [1-1] 61cbcbf9.497 0 LOG:  logical 
replication table synchronization worker for subscription "sub_gwn", table 
"packit4" has started
2021-12-29 02:48:52 UTC [1894]: [1-1] 61cbcc94.766 0 LOG:  logical 
replication table synchronization worker for subscription "sub_dcn", table 
"packit2" has started
2021-12-29 02:51:49 UTC [3175]: [1-1] 61cbcd45.c67 0 LOG:  logical 
replication table synchronization worker for subscription "sub_gwn", table 
"packit2" has started

2021-12-29 02:48:44 UTC [1127]: [2-1] 61cbcbee.467 0 LOG:  logical 
replication table synchronization worker for subscription "sub_dcn", table 
"packit4" has finished
2021-12-29 02:48:47 UTC [1125]: [2-1] 61cbcbee.465 0 LOG:  logical 
replication table synchronization worker for subscription "sub_dcn", table 
"packit3" has finished
2021-12-29 02:51:46 UTC [1175]: [2-1] 61cbcbf9.497 0 LOG:  logical 
replication table synchronization worker for subscription "sub_gwn", table 
"packit4" has finished
2021-12-29 02:51:49 UTC [1173]: [2-1] 61cbcbf9.495 0 LOG:  logical 
replication table synchronization worker for subscription "sub_gwn", table 
"packit3" has finished
2021-12-29 02:51:51 UTC [1894]: [2-1] 61cbcc94.766 0 LOG:  logical 
replication table synchronization worker for subscription "sub_dcn", table 
"packit2" has finished
2021-12-29 02:54:30 UTC [3175]: [2-1] 61cbcd45.c67 0 LOG:  logical 
replication table synchronization worker for subscription "sub_gwn", table 
"packit2" has finished


IMPORTANT - This email and any attachments is intended for the above named 
addressee(s), and may contain information which is confidential or privileged. 
If you are not the intended recipient, please inform the sender immediately and 
delete this email: you should not copy or use this e-mail for any purpose nor 
disclose its contents to any person.


Find missing data in a column

2021-12-29 Thread john polo

Hi,

I have a database in PostgreSQL 12 on Windows. It has > 8,000,000 rows. 
I want to copy this database to PostgreSQL 10 on Slackware Linux. I used 
this command to get the data out of the Windows database:


"C:\Program Files\PostgreSQL\12\bin\pg_dump.exe" 
--file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.dump" 
--host="localhost" --port="5432" --username="postgres" --password 
--verbose --format=c --no-owner --no-privileges --dbname="ebird_work" 
--table="p_loc.ebd_sptl"


On Slackware, I first:

su postgres

Then try:

psql ebirds

SET SEARCH_PATH TO p_loc;

COPY p_loc.ebird_sptl FROM 
'/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.dump';


That fails with

missing data for column "COMMON_NAME"

I understand this means there is a problem with one or more rows in the 
column referenced. This is a column of text. How do I find the error(s) 
in question?


Cheers,

John

--
Enlightenment is ego's ultimate disappointment.
-Chogyam Trungpa





Find missing data in a column

2021-12-29 Thread David G. Johnston
On Wednesday, December 29, 2021, john polo  wrote:

>
> I understand this means there is a problem with one or more rows in the
> column referenced. This is a column of text. How do I find the error(s) in
> question?
>

It doesn’t actually mean anything…you cannot use the copy command to import
the contents of a dump file.  Especially not one dumped using the custom
format.

David J.


Re: Find missing data in a column

2021-12-29 Thread Adrian Klaver

On 12/29/21 09:43, john polo wrote:

Hi,

I have a database in PostgreSQL 12 on Windows. It has > 8,000,000 rows. 
I want to copy this database to PostgreSQL 10 on Slackware Linux. I used 
this command to get the data out of the Windows database:


"C:\Program Files\PostgreSQL\12\bin\pg_dump.exe" 
--file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.dump" 
--host="localhost" --port="5432" --username="postgres" --password 
--verbose --format=c --no-owner --no-privileges --dbname="ebird_work" 
--table="p_loc.ebd_sptl"


On Slackware, I first:

su postgres

Then try:

psql ebirds

SET SEARCH_PATH TO p_loc;

COPY p_loc.ebird_sptl FROM 
'/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.dump';


That fails with

missing data for column "COMMON_NAME"

I understand this means there is a problem with one or more rows in the 
column referenced. This is a column of text. How do I find the error(s) 
in question?


How did you think this would work at all?

--format=c is compressed custom binary format

COPY p_loc.ebird_sptl FROM 
'/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.dump';


Is looking for separated value text format file.

Look at pg_restore:

https://www.postgresql.org/docs/current/app-pgrestore.html



Cheers,

John




--
Adrian Klaver
adrian.kla...@aklaver.com




Re: Find missing data in a column

2021-12-29 Thread Adrian Klaver

On 12/29/21 09:43, john polo wrote:

Hi,

I have a database in PostgreSQL 12 on Windows. It has > 8,000,000 rows. 
I want to copy this database to PostgreSQL 10 on Slackware Linux. I used 
this command to get the data out of the Windows database:


"C:\Program Files\PostgreSQL\12\bin\pg_dump.exe" 
--file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.dump" 
--host="localhost" --port="5432" --username="postgres" --password 
--verbose --format=c --no-owner --no-privileges --dbname="ebird_work" 
--table="p_loc.ebd_sptl"


On Slackware, I first:

su postgres

Then try:

psql ebirds

SET SEARCH_PATH TO p_loc;

COPY p_loc.ebird_sptl FROM 
'/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.dump';


That fails with

missing data for column "COMMON_NAME"

I understand this means there is a problem with one or more rows in the 
column referenced. This is a column of text. How do I find the error(s) 
in question?



If you want to use psql then:

pg_dump.exe" 
--file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt" 
--host="localhost" --port="5432" --username="postgres" --password 
--no-owner --no-privileges --dbname="ebird_work" 
--table="p_loc.ebd_sptl" --data-only


psql ebirds


\i C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt





Cheers,

John




--
Adrian Klaver
adrian.kla...@aklaver.com




Re: Find missing data in a column

2021-12-29 Thread Rob Sargent


> On Dec 29, 2021, at 10:07 AM, Adrian Klaver  wrote:
> 
> On 12/29/21 09:43, john polo wrote:
>> Hi,
>> I have a database in PostgreSQL 12 on Windows. It has > 8,000,000 rows. I 
>> want to copy this database to PostgreSQL 10 on Slackware Linux. I used this 
>> command to get the data out of the Windows database:
>> "C:\Program Files\PostgreSQL\12\bin\pg_dump.exe" 
>> --file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.dump"
>>  --host="localhost" --port="5432" --username="postgres" --password --verbose 
>> --format=c --no-owner --no-privileges --dbname="ebird_work" 
>> --table="p_loc.ebd_sptl"
>> On Slackware, I first:
>> su postgres
>> Then try:
>> psql ebirds
>> SET SEARCH_PATH TO p_loc;
>> COPY p_loc.ebird_sptl FROM 
>> '/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.dump';
>> That fails with
>> missing data for column "COMMON_NAME"
>> I understand this means there is a problem with one or more rows in the 
>> column referenced. This is a column of text. How do I find the error(s) in 
>> question?
> 
> 
> If you want to use psql then:
> 
> pg_dump.exe" 
> --file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt" 
> --host="localhost" --port="5432" --username="postgres" --password --no-owner 
> --no-privileges --dbname="ebird_work" --table="p_loc.ebd_sptl" --data-only
> 
> psql ebirds
> 
> 
> \i C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt
> 

Doesn’t that presume OP can connect to linux db from Windows machine?  Seems 
the best plan would be copy to; file-tranfer; copy from
> 
> 
>> Cheers,
>> John
> 
> 
> -- 
> Adrian Klaver
> adrian.kla...@aklaver.com 


Re: Find missing data in a column

2021-12-29 Thread Adrian Klaver

On 12/29/21 10:10, Rob Sargent wrote:






If you want to use psql then:

pg_dump.exe" 
--file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt" 
--host="localhost" --port="5432" --username="postgres" --password 
--no-owner --no-privileges --dbname="ebird_work" 
--table="p_loc.ebd_sptl" --data-only


psql ebirds


\i C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt



Doesn’t that presume OP can connect to linux db from Windows machine? 
  Seems the best plan would be copy to; file-tranfer; copy from


Yeah that should been the file location from the OP's COPY command:

'/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.txt'





Cheers,
John



--
Adrian Klaver
adrian.kla...@aklaver.com 





--
Adrian Klaver
adrian.kla...@aklaver.com




Re: Find missing data in a column

2021-12-29 Thread Alan Hodgson
On Wed, 2021-12-29 at 12:43 -0500, john polo wrote:
> I have a database in PostgreSQL 12 on Windows. It has > 8,000,000
> rows. 
> I want to copy this database to PostgreSQL 10 on Slackware Linux. I
> used 
> this command to get the data out of the Windows database:
> 
> "C:\Program Files\PostgreSQL\12\bin\pg_dump.exe" 
> --
> file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_
> all.dump" 
> --host="localhost" --port="5432" --username="postgres" --password 
> --verbose --format=c --no-owner --no-privileges --
> dbname="ebird_work" 
> --table="p_loc.ebd_sptl"
> 
> On Slackware, I first:
> 
> su postgres
> 
> Then try:
> 
> psql ebirds
> 
> SET SEARCH_PATH TO p_loc;
> 
> COPY p_loc.ebird_sptl FROM 
> '/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.dump';
> 
> That fails with
> 
> missing data for column "COMMON_NAME"
> 
> I understand this means there is a problem with one or more rows in
> the 
> column referenced. This is a column of text. How do I find the
> error(s) 
> in question?

You're going to want to look into the pg_restore command to restore a
custom format dump file.

If you wanted something to read with COPY FROM you would first dump
it with COPY TO.


csv copy error

2021-12-29 Thread ourdiaspora
Readers,

Please could anyone help with the following error produced:

"
ERROR:  invalid input syntax for integer: "1,m "
CONTEXT:  COPY exampletable, line 1, column examplenumber: "1,m "

The database commands:

"
CREATE TABLE exampletable (examplenumber smallint,
exampletitle varchar(500)
);
"

"
 \copy exampletable from '/local/path/to/examplefile.csv';
"

CSV file contents:

"
1,m
2,m
9,t
"





Re: csv copy error

2021-12-29 Thread Adrian Klaver

On 12/29/21 13:08, ourdiaspora wrote:

Readers,

Please could anyone help with the following error produced:

"
ERROR:  invalid input syntax for integer: "1,m "
CONTEXT:  COPY exampletable, line 1, column examplenumber: "1,m "

The database commands:

"
CREATE TABLE exampletable (examplenumber smallint,
exampletitle varchar(500)
);
"

"
  \copy exampletable from '/local/path/to/examplefile.csv';
"


\copy exampletable from '/local/path/to/examplefile.csv with csv';



CSV file contents:

"
1,m
2,m
9,t
"






--
Adrian Klaver
adrian.kla...@aklaver.com




Re: csv copy error

2021-12-29 Thread David G. Johnston
On Wednesday, December 29, 2021, Adrian Klaver 
wrote:

> On 12/29/21 13:08, ourdiaspora wrote:
>
>>
>> "
>>   \copy exampletable from '/local/path/to/examplefile.csv';
>> "
>>
>
> \copy exampletable from '/local/path/to/examplefile.csv with csv';
>
>
Right idea though that won’t execute for three reasons (bad quoting,
missing parentheses, missing field type for the value csv).  The main issue
is the OP is accepting all defaults but the file format is not in the
default format.  Either the format needs to be changed or the OP needs to
specify a combination of options that describes the file format.
Specifying the csv format I think is a valid solution though there are
others.  The documentation describes the options, syntax, and effects
sufficiently so I will not belabor the details.

David J.


Default values in functions

2021-12-29 Thread Michael Lewis
I am on PG 13.4 and found some surprising behavior with default values. Can
anyone give insight why the last two cases (especially the last one) do not
give the result I expected? If I uncomment the line to set pArrayToCheck
with coalesce, then it gives the expected results though.

If I can somehow pass "use default for this parameter" to functions like I
can for insert statements, then that would be great to know. Generally, the
use case I am looking at is having a function with a few required
parameters leading and then many optional and I'd like to ensure the
optional ones get the default set if a value is used that "is not distinct
from null" basically. Hopefully the example is clear.


CREATE OR REPLACE FUNCTION public.check_if_input_is_empty_array(
pArrayToCheck integer[] DEFAULT ARRAY[]::integer[], inout pTimeToDisplay
timestamptz DEFAULT CURRENT_DATE::timestamptz, out lReturnValue boolean )
LANGUAGE plpgsql
AS $function$
BEGIN
--pArrayToCheck = COALESCE( pArrayToCheck::integer[],
ARRAY[]::integer[] );

SELECT icount ( pArrayToCheck ) = 0 INTO lReturnValue;
SELECT pTimeToDisplay AT TIME ZONE 'UTC' INTO pTimeToDisplay;

END;
$function$;

select ( check_if_input_is_empty_array() ).*, true as expected_result
UNION ALL
select ( check_if_input_is_empty_array( pArrayToCheck, pTimeToDisplay )
).*, expected_result
from(
values
( ARRAY[]::int[], CURRENT_DATE + interval '1 hour', true ),
( ARRAY[1]::int[], CURRENT_DATE + interval '2 hour', false ),
( null::int[] , CURRENT_DATE + interval '3 hour', true ),
( null , CURRENT_DATE + interval '4 hour', true )
)AS sub ( pArrayToCheck, pTimeToDisplay, expected_result );


*Michael Lewis  |  Database Engineer*
*Entrata*


Re: Default values in functions

2021-12-29 Thread Tom Lane
Michael Lewis  writes:
> I am on PG 13.4 and found some surprising behavior with default values. Can
> anyone give insight why the last two cases (especially the last one) do not
> give the result I expected? If I uncomment the line to set pArrayToCheck
> with coalesce, then it gives the expected results though.

I don't think your concerns have anything to do with the default
parameters, but rather with the operations the function is performing:

> SELECT icount ( pArrayToCheck ) = 0 INTO lReturnValue;

You didn't say what icount() is, but if it's the one from
contrib/intarray, it's STRICT meaning it'll return NULL,
not zero, for a null array input.  Judging from your
expected_results, you want something more like

SELECT coalesce(icount(pArrayToCheck), 0) = 0 INTO lReturnValue;

(Or IOW, null::int[] is not at all the same thing as array[]::int[].)

> SELECT pTimeToDisplay AT TIME ZONE 'UTC' INTO pTimeToDisplay;

This is very unlikely to produce anything sane.  The AT TIME ZONE
construct produces a timestamp-without-time-zone, which will then
be rotated per your TimeZone setting while coercing it back to
timestamp-with-time-zone for assignment to the output parameter.
You'll end up with a net rotation equal to your local zone's GMT offset.
For example:

postgres=# show timezone;
 TimeZone 
--
 America/New_York
(1 row)

postgres=# select CURRENT_DATE::timestamptz;
  current_date  

 2021-12-29 00:00:00-05
(1 row)

postgres=# select CURRENT_DATE::timestamptz AT TIME ZONE 'UTC';
  timezone   
-
 2021-12-29 05:00:00
(1 row)

postgres=# select (CURRENT_DATE::timestamptz AT TIME ZONE 'UTC')::timestamptz;
timezone

 2021-12-29 05:00:00-05
(1 row)

I have no idea what you were hoping to accomplish there, so
I have no suggestion what to do instead.

regards, tom lane




Re: Default values in functions

2021-12-29 Thread David G. Johnston
On Wednesday, December 29, 2021, Michael Lewis  wrote:
>
>
> If I can somehow pass "use default for this parameter" to functions like I
> can for insert statements, then that would be great to know.
>
>
There is not.


>
> Generally, the use case I am looking at is having a function with a few
> required parameters leading and then many optional and I'd like to ensure
> the optional ones get the default set if a value is used that "is not
> distinct from null" basically.
>
>
That isn’t how it works.  Absence is what is important.  Null is not
absence.  As you showed, if you want nulls to be converted to defaults you
can use coalesce.

David J.


Re: Default values in functions

2021-12-29 Thread Michael Lewis
On Wed, Dec 29, 2021, 4:34 PM David G. Johnston 
wrote:

> That isn’t how it works.  Absence is what is important.  Null is not
> absence.  As you showed, if you want nulls to be converted to defaults you
> can use coalesce.
>

Thanks sir. It seems unfortunate that there is not a way to indicate
absence of the third parameter if I need to set a value for the fourth
parameter.


Re: Default values in functions

2021-12-29 Thread Michael Lewis
On Wed, Dec 29, 2021, 4:31 PM Tom Lane  wrote:

> You didn't say what icount() is, but if it's the one from
> contrib/intarray, it's STRICT meaning it'll return NULL,
> not zero, for a null array input.


Thanks for that. Very good to know.

(Or IOW, null::int[] is not at all the same thing as array[]::int[].)
>

Understood. My hope is to pass a parameter that gets overridden by the
default so that I can pass other parameters that come after.


> SELECT pTimeToDisplay AT TIME ZONE'UTC' INTO pTimeToDisplay;
>
> This is very unlikely to produce anything sane.


Sorry for that confusion. It was intended as an example of non default
later in the list after a default.


Re: Default values in functions

2021-12-29 Thread Tom Lane
Michael Lewis  writes:
> Understood. My hope is to pass a parameter that gets overridden by the
> default so that I can pass other parameters that come after.

As David explained, function parameters don't work that way.
You could mechanize something like substitute-a-default-for-
null-input, but you'll have to do it with explicit logic.

regards, tom lane




Re: Default values in functions

2021-12-29 Thread Tom Lane
Michael Lewis  writes:
> Thanks sir. It seems unfortunate that there is not a way to indicate
> absence of the third parameter if I need to set a value for the fourth
> parameter.

The way to do that is to use named parameters and the associated
call syntax, ie something like

select myfunc(param1 => 42, param3 => 99);

regards, tom lane




Re: Default values in functions

2021-12-29 Thread Michael Lewis
On Wed, Dec 29, 2021, 5:31 PM Tom Lane  wrote:

> The way to do that is to use named parameters and the associated
> call syntax, ie something like
>
> select myfunc(param1 => 42, param3 => 99);
>

Thanks very much. I have not seen that before.

>


Re: Find missing data in a column

2021-12-29 Thread john polo

On 12/29/2021 1:16 PM, Adrian Klaver wrote:

On 12/29/21 10:10, Rob Sargent wrote:






If you want to use psql then:

pg_dump.exe" 
--file="C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt" 
--host="localhost" --port="5432" --username="postgres" --password 
--no-owner --no-privileges --dbname="ebird_work" 
--table="p_loc.ebd_sptl" --data-only


psql ebirds


\i C:\Users\Nightrunner\DOCUMENTS\programming\pg_out\ebird_sptl_all.txt



Doesn’t that presume OP can connect to linux db from Windows machine? 
  Seems the best plan would be copy to; file-tranfer; copy from


Yeah that should been the file location from the OP's COPY command:

'/nt-d/projects_and_data/ebd_OR/ebird_sptl_all.txt'


Thanks, everyone, for the replies.

Thanks, Adrian, for the helpful commands you provided. They worked up to 
a point that gave me a different error as the data were loading. I will 
spend some time trying to work that new error out.


Cheers,

John






pg_config header files are missing - Postgres 13 - Amazon Linux 2

2021-12-29 Thread Hasan Marzooq
Hello!

We've a web application in play framework which uses Postgres 9.6 with plv8
and uuid-ossp extension. We now want to use Postgres 13 instead of 9.6. To
achieve this, I'm trying to install Postgres 13 (on the same host where 9.6
is installed) with plv8 and uuid-ossp extension.

PLV8  "make" uses "pg_config" to get the latest
version of Postgres (in case multiple Postgres are installed). However,
when running "make" with Postgres 13's pg_config, its giving error:

cat: /usr/pgsql-13/include/server/pg_config*.h: No such file or directory

using command: make PG_CONFIG=/usr/pgsql-13/bin/pg_config

I see the header files are missing, in fact there is no "include" folder
inside "/usr/pgsql-13/"
--
# ll /usr/pgsql-13
total 16
drwxr-xr-x 2 root root 4096 Dec 29 02:31 bin
drwxr-xr-x 3 root root   23 Dec 29 02:31 doc
drwxr-xr-x 3 root root 4096 Dec 29 02:31 lib
drwxr-xr-x 8 root root 4096 Dec 29 02:31 share
---

Header files (and include folder) do exist in Postgres 9.6's pg_config.

After a bit of research I found that probably installing
"postgresql13-devel.x86_64" will install pg_config with headers. However,
when installing "postgresql13-devel.x86_64" via yum, it says,
--
Error: Package: postgresql13-devel-13.5-1PGDG.rhel7.x86_64 (pgdg13)
   Requires: llvm-toolset-7-clang >= 4.0.1
--
I didn't find "llvm-toolset-7-clang" from yum repo, except from the RHEL
subscription manager, which is paid for non-dev stuff. So I tried to build
llvm-toolset-clang from scratch, but that doesn't solve the problem.

I'm not sure why the header files of Postgres 13's pg_config are missing?
It appears pg_config got installed as part of Postgres 13 itself. I'm also
not sure if copying 9.6 pg_config header files to 13 is the correct way?

What would be the next steps here? Please advise.

Some info about host machine: This is Amazon Linux 2
---
# cat /proc/version
Linux version 4.14.256-197.484.amzn2.x86_64 (mockbuild@ip-10-0-37-156) (gcc
version 7.3.1 20180712 (Red Hat 7.3.1-13) (GCC)) #1 SMP Tue Nov 30 00:17:50
UTC 2021
---
--
yum list installed | grep -i postgre
postgresql13.x86_6413.5-1PGDG.rhel7  @pgdg13
postgresql13-contrib.x86_6413.5-1PGDG.rhel7  @pgdg13
postgresql13-libs.x86_64   13.5-1PGDG.rhel7  @pgdg13
postgresql13-server.x86_64 13.5-1PGDG.rhel7  @pgdg13
postgresql96.x86_649.6.24-1PGDG.rhel6@pgdg96
postgresql96-contrib.x86_649.6.24-1PGDG.rhel6@pgdg96
postgresql96-devel.x86_64  9.6.24-1PGDG.rhel6@pgdg96
postgresql96-libs.x86_64   9.6.24-1PGDG.rhel6@pgdg96
postgresql96-server.x86_64 9.6.24-1PGDG.rhel6@pgdg96
---

Thanks!
Naqvi


Re: csv copy error

2021-12-29 Thread Guillaume Lelarge
Hi,

Le mer. 29 déc. 2021 à 22:08, ourdiaspora  a
écrit :

> Readers,
>
> Please could anyone help with the following error produced:
>
> "
> ERROR:  invalid input syntax for integer: "1,m "
> CONTEXT:  COPY exampletable, line 1, column examplenumber: "1,m "
>
> The database commands:
>
> "
> CREATE TABLE exampletable (examplenumber smallint,
> exampletitle varchar(500)
> );
> "
>
> "
>  \copy exampletable from '/local/path/to/examplefile.csv';
> "
>
> CSV file contents:
>
> "
> 1,m
> 2,m
> 9,t
> "
>
>
You should tell the CSV command you're using a CSV file. By default, COPY
thinks it's a TSV file.


-- 
Guillaume.