Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Adrian Klaver



Then deal with the fact it is no longer installed to pg_control but 
instead pgivm. With usual schema qualifications or search_path techniques.



Thank you, it worked.  now pgivm.create_immv works.

I should have got it before.


Did you not read my previous post?






--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist



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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane


On 3/2/25 08:44, Adrian Klaver wrote:


Then deal with the fact it is no longer installed to pg_control but 
instead pgivm. With usual schema qualifications or search_path 
techniques.



Thank you, it worked.  now pgivm.create_immv works.

I should have got it before.


Did you not read my previous post?

Actually I depend on a screen reader given my total blindness. Somehow 
it is playing some tricks with thunderbird these days.


Some times when there are multiple nested blocks, I may miss the text.

But any ways thank you very much.

I had doubted it on similar lines, but could not pinpoint the issue.

Regards.






--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist




--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread Tom Lane
me nefcanto  writes:
> Can you please provide a row-level catch-all handler for the copy command?

Very unlikely to happen.  COPY is not intended as a general purpose
ETL mechanism, and we don't want to load it down with features that
would create substantial performance penalties.  Which that would.

Even ignoring the performance angle, this request seems remarkably
ill-specified.  What is a "row-level handler" for errors that have
to do with identifying row boundaries?

regards, tom lane




Re: Version compatibility

2025-03-01 Thread Igor Korot
Hi, Adrian,


On Sat, Mar 1, 2025 at 12:31 PM Adrian Klaver  wrote:
>
> On 3/1/25 14:17, Igor Korot wrote:
>
> Reply to list also.
> Ccing list.
>
> Comments inline.
>
> > Hi, Adrian,
> > On Sat, Mar 1, 2025 at 11:23 AM Adrian Klaver  > > wrote:
> >
> > On 3/1/25 13:15, Igor Korot wrote:
> >  > Hi, ALL,
> >  > I have PostgreSQL version 13 and ODBC driver version 11
> >  > on my Gentoo box.
> >  >
> >  > Are they compatible? Can I still connect to the server?
> >
> > Have you tried to make a connection?
> >
> >
> > Tried.
> >
> > [code]
> > IgorsGentoo/home/igor/dbhandler_new/Debug #cat /etc/unixODBC/odbcinst.ini
> > Trace=yes
> > TraceFile=/tmp/sql.log
> > [PostgreSQL]
> > Description=PostgreSQL drver
> > Driver=/usr/lib64/psqlodbcw.so
> >
> > IgorsGentoo/home/igor/dbhandler_new/Debug #cat /etc/unixODBC/odbc.ini
> > [PostgreSQL]
> > Driver=PostgreSQL
> > Server=localhost
> > PORT=5432
> > DATABASE=draft
> > OOPTION=3
> > USER=postgres
> > PASSWORD=wasqra
> > IgorsGentoo/home/igor/dbhandler_new/Debug #
> >
> > igor@IgorsGentoo~/dbhandler/Debug $isql -v PostgreSQL
> > [IM002][unixODBC][Driver Manager]Data source name not found and no
> > default driver specified
> > [ISQL]ERROR: Could not SQLConnect
> > igor@IgorsGentoo~/dbhandler/Debug $
> >
> > [/code]
>
> From:
>
> https://www.mankier.com/1/isql
>
> "DSN
>
>  The Data Source Name (DSN) used to connect to the SQL database.
> unixODBC looks for the specified DSN in /etc/odbc.ini and
> $HOME/.odbc.ini, with the latter taking precedence.
> "
>
> Do you have a $HOME/.odbc.ini?
>
> Also in odbc.ini, per man odbc.ini, I believe you have to have something
> like:
>
> [ODBC Data Sources]
> Postgresql = This is my Postgres DSN.

I added it and now my odbc.n look like this:

[code]
igor@IgorsGentoo ~/dbhandler/Debug $ cat /etc/unixODBC/odbc.ini
[ODBC Data Sources]
PostgreSQL = This is my Postgres DSN.

[PostgreSQL]
Driver=PostgreSQL
Server=localhost
PORT=5432
DATABASE=draft
OOPTION=3
USER=postgres
PASSWORD=wasqra
igor@IgorsGentoo ~/dbhandler/Debug $

[/code]

And there is no .odbc.nii n the ~:

[code]
igor@IgorsGentoo ~/dbhandler/Debug $ ls -la ~/.o*
-rw-r--r-- 1 igor igor 0 Mar  1 23:10 /home/igor/.odbc.ini
igor@IgorsGentoo ~/dbhandler/Debug $ cat /home/igor/.odbc.ini
igor@IgorsGentoo ~/dbhandler/Debug $
[/code]

Apparently the file is created when  run "isql -v PostgreSQL".
I will look into that.

Thx.



>
>  From man odbc.ini:
>
> "[ODBC Data Sources] section
>
> The required section [ODBC Data Sources] lists each data source name
> (DSN) as a key. The associated values serve as comments. Each  entry
> must be matched by an ini file [section] describing the data source.
> "
>
> > I'd like to develop backward compatible software which is compatible
> > with the oldest possible combination..
>
> Not following.
>  From my experiences with the ODBC driver it is backwards compatible, so
> I would think using a more recent version would be the preferred solution.
>
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>




Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane


On 3/2/25 07:23, Adrian Klaver wrote:

On 3/1/25 17:39, Krishnakant Mane wrote:




But when I try creating the same immv on the server it says 
function create_immv (unknown, unknown ) does not exist.


Connect with psql then do:

1) \dx
This will show what extensions are installed and in what schema.


pg_ivm | 1.10 | pg_catalog

plpgsql | 1.0 | pg_catalog.



2) show search_path;
"$user" public.
3) \df *.create_immv
pgivm | create_immv | bigint | text, text | func.
Provide the outputs from the above three commands in your response.


See above and provide answers.


--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane


On 3/2/25 07:03, Adrian Klaver wrote:

On 3/1/25 17:25, Krishnakant Mane wrote:


On 3/1/25 22:17, Adrian Klaver wrote:

On 2/28/25 21:29, Krishnakant Mane wrote:

All done, but no result.

I feel it is possible that the latest code must be flawed or 
something.


Well, as a matter of fact, I never had to compile the extention on 
my local ubuntu 24.04 machine.


How did you install Postgres on the AWS EC2 instance?


Please answer above.
sudo apt-get install postgresql postgresql-server-dev-16


Did you install the postgresql-server-dev-16 package?


Yes I did.



Define not work.



create extension command works successfully.

But when I try creating the same immv on the server it says function 
create_immv (unknown, unknown ) does not exist.


Connect with psql then do:

1) \dx
This will show what extensions are installed and in what schema.

2) show search_path;

3) \df *.create_immv

Provide the outputs from the above three commands in your response.




Note that this works on my local machine.



Regards.

On 3/1/25 00:10, Ron Johnson wrote:



--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile:
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/




--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Adrian Klaver

On 3/1/25 17:25, Krishnakant Mane wrote:


On 3/1/25 22:17, Adrian Klaver wrote:

On 2/28/25 21:29, Krishnakant Mane wrote:

All done, but no result.

I feel it is possible that the latest code must be flawed or something.

Well, as a matter of fact, I never had to compile the extention on my 
local ubuntu 24.04 machine.


How did you install Postgres on the AWS EC2 instance?


Please answer above.



Did you install the postgresql-server-dev-16 package?


Yes I did.



Define not work.



create extension command works successfully.

But when I try creating the same immv on the server it says function 
create_immv (unknown, unknown ) does not exist.


Connect with psql then do:

1) \dx
This will show what extensions are installed and in what schema.

2) show search_path;

3) \df *.create_immv

Provide the outputs from the above three commands in your response.




Note that this works on my local machine.



Regards.

On 3/1/25 00:10, Ron Johnson wrote:



--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/



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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane


On 3/1/25 22:17, Adrian Klaver wrote:

On 2/28/25 21:29, Krishnakant Mane wrote:

All done, but no result.

I feel it is possible that the latest code must be flawed or something.

Well, as a matter of fact, I never had to compile the extention on my 
local ubuntu 24.04 machine.


How did you install Postgres on the AWS EC2 instance?

Did you install the postgresql-server-dev-16 package?


Yes I did.


I just did a create extention and it worked just fine.

But on my aws server I had to compile it manually and still it does 
not work.


Define not work.



create extension command works successfully.

But when I try creating the same immv on the server it says function 
create_immv (unknown, unknown ) does not exist.


Note that this works on my local machine.



Regards.

On 3/1/25 00:10, Ron Johnson wrote:



--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Adrian Klaver

On 3/1/25 17:39, Krishnakant Mane wrote:




But when I try creating the same immv on the server it says function 
create_immv (unknown, unknown ) does not exist.


Connect with psql then do:

1) \dx
This will show what extensions are installed and in what schema.

2) show search_path;

3) \df *.create_immv

Provide the outputs from the above three commands in your response.


See above and provide answers.

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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane

Yes perfect thank you.

Besides, I will soon switch over to Mac air m3 and voice over does not 
have such problems.


This screen reader Orca is great as well and I am very sure, that it 
being open source, will have the issue fixed at the earliest.


Regards.

On 3/2/25 09:53, Adrian Klaver wrote:

On 3/1/25 19:35, Krishnakant Mane wrote:


For my future reference does something like this response work better?


--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: Version compatibility

2025-03-01 Thread Adrian Klaver

On 3/1/25 21:17, Igor Korot wrote:



Do you have a $HOME/.odbc.ini?

Also in odbc.ini, per man odbc.ini, I believe you have to have something
like:

[ODBC Data Sources]
Postgresql = This is my Postgres DSN.


I added it and now my odbc.n look like this:

[code]
igor@IgorsGentoo ~/dbhandler/Debug $ cat /etc/unixODBC/odbc.ini
[ODBC Data Sources]
PostgreSQL = This is my Postgres DSN.

[PostgreSQL]
Driver=PostgreSQL
Server=localhost
PORT=5432
DATABASE=draft
OOPTION=3
USER=postgres
PASSWORD=wasqra
igor@IgorsGentoo ~/dbhandler/Debug $


Did the connection work after making the change?



[/code]

And there is no .odbc.nii n the ~:

[code]
igor@IgorsGentoo ~/dbhandler/Debug $ ls -la ~/.o*
-rw-r--r-- 1 igor igor 0 Mar  1 23:10 /home/igor/.odbc.ini
igor@IgorsGentoo ~/dbhandler/Debug $ cat /home/igor/.odbc.ini
igor@IgorsGentoo ~/dbhandler/Debug $
[/code]

Apparently the file is created when  run "isql -v PostgreSQL".
I will look into that.

Thx.





  From man odbc.ini:

"[ODBC Data Sources] section

 The required section [ODBC Data Sources] lists each data source name
(DSN) as a key. The associated values serve as comments. Each  entry
must be matched by an ini file [section] describing the data source.
"


I'd like to develop backward compatible software which is compatible
with the oldest possible combination..


Not following.
  From my experiences with the ODBC driver it is backwards compatible, so
I would think using a more recent version would be the preferred solution.



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



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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Adrian Klaver

On 3/1/25 19:35, Krishnakant Mane wrote:


For my future reference does something like this response work better?

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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Adrian Klaver

On 3/1/25 18:14, Krishnakant Mane wrote:


On 3/2/25 07:23, Adrian Klaver wrote:

On 3/1/25 17:39, Krishnakant Mane wrote:




But when I try creating the same immv on the server it says 
function create_immv (unknown, unknown ) does not exist.


Connect with psql then do:

1) \dx
This will show what extensions are installed and in what schema.


pg_ivm | 1.10 | pg_catalog

plpgsql | 1.0 | pg_catalog.



2) show search_path;
"$user" public.
3) \df *.create_immv
pgivm | create_immv | bigint | text, text | func.
Provide the outputs from the above three commands in your response.


See above and provide answers.


So the extension functions are in the pgivm schema.

You will need to either always schema qualify the functions:

select pgivm.create_imv();

or  add the pgivm schema to the search_path.

For how to do that see the link I provided earlier in this thread:

https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH

Using the info from above you will probably want to persist the 
search_path setting in postgresql.conf as:


https://www.postgresql.org/docs/current/runtime-config-client.html

as

search_path






--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/



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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread David G. Johnston
On Saturday, March 1, 2025, Krishnakant Mane  wrote:

>
> pg_ivm | 1.10 | pg_catalog
>
> plpgsql | 1.0 | pg_catalog.
>
>
> 2) show search_path;
> "$user" public.
> 3) \df *.create_immv
> pgivm | create_immv | bigint | text, text | func.
> Provide the outputs from the above three commands in your response.
>
> See this issue for why this is different now.

https://github.com/sraoss/pg_ivm/pull/116

Then deal with the fact it is no longer installed to pg_control but instead
pgivm. With usual schema qualifications or search_path techniques.

David J.


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane


On 3/2/25 07:54, David G. Johnston wrote:

On Saturday, March 1, 2025, Krishnakant Mane  wrote:


pg_ivm | 1.10 | pg_catalog

plpgsql | 1.0 | pg_catalog.



2) show search_path;
"$user" public.
3) \df *.create_immv
pgivm | create_immv | bigint | text, text | func.
Provide the outputs from the above three commands in your response.


See this issue for why this is different now.

https://github.com/sraoss/pg_ivm/pull/116

Then deal with the fact it is no longer installed to pg_control but 
instead pgivm. With usual schema qualifications or search_path techniques.

Thank you david.


Can you tell me how exactly should the syntax be?

Is my function definition wrong?



David J.


--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane


On 3/2/25 07:54, David G. Johnston wrote:

On Saturday, March 1, 2025, Krishnakant Mane  wrote:


pg_ivm | 1.10 | pg_catalog

plpgsql | 1.0 | pg_catalog.



2) show search_path;
"$user" public.
3) \df *.create_immv
pgivm | create_immv | bigint | text, text | func.
Provide the outputs from the above three commands in your response.


See this issue for why this is different now.

https://github.com/sraoss/pg_ivm/pull/116

Then deal with the fact it is no longer installed to pg_control but 
instead pgivm. With usual schema qualifications or search_path techniques.



Thank you, it worked.  now pgivm.create_immv works.

I should have got it before.


David J.


--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread David G. Johnston
On Saturday, March 1, 2025, Krishnakant Mane  wrote:
>
> Can you tell me how exactly should the syntax be?
>

https://www.postgresql.org/docs/current/ddl-schemas.html

> Is my function definition wrong?
>

It isn’t a function definition, it is a function call.

David J.


Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Adrian Klaver

On 2/28/25 21:29, Krishnakant Mane wrote:

All done, but no result.

I feel it is possible that the latest code must be flawed or something.

Well, as a matter of fact, I never had to compile the extention on my 
local ubuntu 24.04 machine.


How did you install Postgres on the AWS EC2 instance?

Did you install the postgresql-server-dev-16 package?



I just did a create extention and it worked just fine.

But on my aws server I had to compile it manually and still it does not 
work.


Define not work.



Regards.

On 3/1/25 00:10, Ron Johnson wrote:


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





Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread Adrian Klaver

On 3/1/25 07:18, me nefcanto wrote:

Hello


All of these scenarios are such that data sanitation is difficult if not 
possible before doing the bulk operation (copy).


I realized that when we specify `on_error ignore` it just handles a 
handful of errors. I thought this was a bug and sent an email to the 
pgsql-bugs maling list. But they said it's the intended behavior.




Take a look at:

http://ossc-db.github.io/pg_bulkload/index.html

and

https://pgloader.io/

They may be able to meet your needs.



Regards
Saeed


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





Version compatibility

2025-03-01 Thread Igor Korot
Hi, ALL,
I have PostgreSQL version 13 and ODBC driver version 11
on my Gentoo box.

Are they compatible? Can I still connect to the server?

Thank you.

P.S.: Sorry if the question belongs to DBC ML. it's hard to make a
distinction...




Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread Greg Sabino Mullane
FYI the -bugs thread in question:

https://www.postgresql.org/message-id/flat/CAEHBEOBCweDWGNHDaUk4%3D10HG0QXXJJAGXbEnFLMB30M%2BQw%2Bdg%40mail.gmail.com

seems to imply the primary blocker was a unique constraint.

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support


Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread David G. Johnston
On Sat, Mar 1, 2025 at 9:20 AM Tom Lane  wrote:

> me nefcanto  writes:
> > Can you please provide a row-level catch-all handler for the copy
> command?
>
> Very unlikely to happen.  COPY is not intended as a general purpose
> ETL mechanism, and we don't want to load it down with features that
> would create substantial performance penalties.  Which that would.
>

Maybe it isn't a general purpose ETL tool but there is no reasonable way to
do some things unless COPY can be put into a mode that doesn't have the
same performance requirements it needs to serve as our dump/restore tool of
choice.

I have to imagine such a mode, if not enabled, would have little to no
impact on how COPY behaves compared to today.  It's kinda like VACUUM FULL
existing doesn't impact how VACUUM behaves.  Seems more desirable than
inventing a whole new SQL Command to do this and copy-paste all of the COPY
code since it does mostly the same thing.

In short, it's probably worth giving it a try if someone wants to.
Rejecting it without seeing the proposal seems premature.

Now, it's probably challenging enough that if the person requesting the
feature isn't driving its development the odds of it getting worked on is
fairly low.

David J.


Re: Version compatibility

2025-03-01 Thread Adrian Klaver

On 3/1/25 13:15, Igor Korot wrote:

Hi, ALL,
I have PostgreSQL version 13 and ODBC driver version 11
on my Gentoo box.

Are they compatible? Can I still connect to the server?


Have you tried to make a connection?

Is there some sort of issue that prevents you from updating the ODBC 
driver on Gentoo?




Thank you.

P.S.: Sorry if the question belongs to DBC ML. it's hard to make a
distinction...




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





Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread Krishnakant Mane

All done, but no result.

I feel it is possible that the latest code must be flawed or something.

Well, as a matter of fact, I never had to compile the extention on my 
local ubuntu 24.04 machine.


I just did a create extention and it worked just fine.

But on my aws server I had to compile it manually and still it does not 
work.


Regards.

On 3/1/25 00:10, Ron Johnson wrote:
When you know that the SELECT statement runs on the local machines, 
then on each server, run these SQL statements:


SHOW search_path;
|SELECT * FROM pg_extension;|

On Fri, Feb 28, 2025 at 12:26 PM Krishnakant Mane 
 wrote:



On 2/28/25 22:53, Ron Johnson wrote:


Differing search_path values can lead to problems like this.


So what can I do to resolve this?

On Fri, Feb 28, 2025 at 12:01 PM Krishnakant Mane
 wrote:

Ok here you go.

select create_immv('plantskillpayment', 'select distinct
kwapp_plant.id  as plantid,
kwapp_skill.id  as skillid,
kwapp_skill.skillname, kwapp_plant.plantname,
kwapp_pltsklpaylvl.level, kwapp_pltsklpaylvl.pay from
kwapp_skill, kwapp_plant,  kwapp_pltsklpaylvl  where
kwapp_skill.id   =
kwapp_pltsklpaylvl.skillid_id  and kwapp_plant.id
 = kwapp_pltsklpaylvl.plantid_id');


You see, the point is this works perfectly on all local
machines with exact same versions and same data.

Regards.

On 2/28/25 22:24, Ron Johnson wrote:

On Fri, Feb 28, 2025 at 11:41 AM Krishnakant Mane
 wrote:

Hello all.

I am not able to use create_immv in postgresql 16.6 even
after installing it and doing create extention.

I did a git clone of the repository and then make sudo
make install to install it.

The issue is not happening on my local ubuntu 24.04
machine but on ubuntu 24.04 on aws free tier.

All dependencies are in place, that's why the extention
got installed in the first place.

I get the error "function create_immv(unknown, unknown)
does not exist.

all the tables related to this view exist, data is
present and same setup works perfectly on my local
machine, same OS and postgresql version.

Can someone suggest what could be the solution?

Show your work!

What command did you run to get that error?

-- 
Death to , and butter sauce.

Don't boil me, I'm still alive.
 lobster!
-- 
*Krishnakant Mane*

Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/



-- 
Death to , and butter sauce.

Don't boil me, I'm still alive.
 lobster!
-- 
*Krishnakant Mane*

Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/



--
Death to , and butter sauce.
Don't boil me, I'm still alive.
 lobster!

--
Email Signature
*Krishnakant Mane*
Software Architecture Design & Implementation Specialist


Mobile: 
+91 8424039903

https://www.linkedin.com/in/krishnakant-r-mane/


Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread me nefcanto
Hello

Please consider these scenarios:

- I want to create a million fake products, sometimes even 100 million
(we're on MariaDB now and we plan to migrate to Postgres). My team uses
fake data for performance tests and other use cases.
- Another scenario is translations. Even in production, we have translation
files for more than 20 languages, and for more than 2 thousand keys. That
means we need to insert 40 thousand translation records in the production.
- Another scenario is updating nested model values for a large hierarchical
table. For example, the categories table. Anytime the user changes a record
in that table we need to recalculate the nested model for the entire
categories and bulk update the results.

All of these scenarios are such that data sanitation is difficult if not
possible before doing the bulk operation (copy).

I realized that when we specify `on_error ignore` it just handles a handful
of errors. I thought this was a bug and sent an email to the pgsql-bugs
maling list. But they said it's the intended behavior.

Can you please provide a row-level catch-all handler for the copy command?

Regards
Saeed


Re: Version compatibility

2025-03-01 Thread Adrian Klaver

On 3/1/25 14:17, Igor Korot wrote:

Reply to list also.
Ccing list.

Comments inline.


Hi, Adrian,
On Sat, Mar 1, 2025 at 11:23 AM Adrian Klaver > wrote:


On 3/1/25 13:15, Igor Korot wrote:
 > Hi, ALL,
 > I have PostgreSQL version 13 and ODBC driver version 11
 > on my Gentoo box.
 >
 > Are they compatible? Can I still connect to the server?

Have you tried to make a connection?


Tried.

[code]
IgorsGentoo/home/igor/dbhandler_new/Debug #cat /etc/unixODBC/odbcinst.ini
Trace=yes
TraceFile=/tmp/sql.log
[PostgreSQL]
Description=PostgreSQL drver
Driver=/usr/lib64/psqlodbcw.so

IgorsGentoo/home/igor/dbhandler_new/Debug #cat /etc/unixODBC/odbc.ini
[PostgreSQL]
Driver=PostgreSQL
Server=localhost
PORT=5432
DATABASE=draft
OOPTION=3
USER=postgres
PASSWORD=wasqra
IgorsGentoo/home/igor/dbhandler_new/Debug #

igor@IgorsGentoo~/dbhandler/Debug $isql -v PostgreSQL
[IM002][unixODBC][Driver Manager]Data source name not found and no 
default driver specified

[ISQL]ERROR: Could not SQLConnect
igor@IgorsGentoo~/dbhandler/Debug $

[/code]


From:

https://www.mankier.com/1/isql

"DSN

The Data Source Name (DSN) used to connect to the SQL database. 
unixODBC looks for the specified DSN in /etc/odbc.ini and 
$HOME/.odbc.ini, with the latter taking precedence.

"

Do you have a $HOME/.odbc.ini?

Also in odbc.ini, per man odbc.ini, I believe you have to have something 
like:


[ODBC Data Sources]
Postgresql = This is my Postgres DSN.

From man odbc.ini:

"[ODBC Data Sources] section

	The required section [ODBC Data Sources] lists each data source name 
(DSN) as a key. The associated values serve as comments. Each  entry 
must be matched by an ini file [section] describing the data source.

"


I'd like to develop backward compatible software which is compatible
with the oldest possible combination..


Not following.
From my experiences with the ODBC driver it is backwards compatible, so 
I would think using a more recent version would be the preferred solution.




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