PostgreSQL error logging options not recognised - postgresql

As noted here I'm trying to use the PostgreSQL COPY ERROR_LOGGING, ERROR_LOGGING_SKIP_BAD_ROWS options.
My SQL looks like this:
COPY users FROM 'C:\Users\admin\osmosis_temp\users.txt'
(ERROR_LOGGING, ERROR_LOGGING_SKIP_BAD_ROWS);
I get an SQL output of ERROR: option "error_logging" not recognized. Am I missing something that turns on the error logging in the first place?
PostgreSQL 9.3

At the top of the wiki page you've linked to one reads:
Error logging in COPY was a proposed feature developed by Aster Data against the PostgreSQL 9.0 code base. It was submitted and reviewed (1) but not accepted into the core product for that or any other version so far.
So that was only a concept.

Related

Wagtail 4.0.1 Admin/Search not working with Postgres PostgreSQL 12.12 Database

I have this issue related to the pages search, on the admin side of wagtail. This is the Django Error:
ProgrammingError at /admin/pages/search/
function ts_rank(unknown, text, tsquery) does not exist
LINE 1: ...ry"."body") ## (to_tsquery('''irp''')) ORDER BY ((ts_rank('{...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
When i debug the wagtail code, the pages query result returns this:
Unable to get repr for <class 'wagtail.search.backends.database.postgres.postgres.PostgresSearchResults'>
After looking at wagtail 4 documentation, there's no info about the postgres search engine. Only in documentation up to 2.15 version. And this:
WAGTAILSEARCH_BACKENDS = {
"default": {
"BACKEND": "wagtail.search.backends.database",
}
}
...should work with Postrgres from then on.
The data base was originally in SQLite and then i migrated to Postgres with pgloader
Is there any configuration/upgrade I missed to make wagtails admin search work with postgres? Can the problem be an error caused by the migration?
After talking with Wagtail Support via Slack they've told me that the error is caused by the pgloader migration. Since it was a small project on-develpoment project i decided to rerun the migrations in a new database but it's not the best solution if you have lots of data already.

Is there a way to use Flyway on AS400?

I need to implement migration tool like Flyway in order to use Jenkins to deploy DB changes.
I tried to add jt400.jar file and added configuration as follows:
flyway.url=jdbc:as400://192.168.171.251:446/DBDEV
flyway.driver=com.ibm.as400.access.AS400JDBCDriver
as a driver and it would not connect with this message:
ERROR: No database found to handle jdbc:as400://192.168.171.251:446/DBDEV
I also tried with using IBM DB2 driver and had configuration
flyway.url=jdbc:db2://192.168.171.251:50000/DBDEV
flyway.driver=com.ibm.db2.jcc.DB2Driver
this time I am getting this kind of refusal message
ERROR:
Unable to obtain connection from database (jdbc:db2://192.168.171.251:50000/DBDEV) for user 'DEVUSER':
[jcc][t4][2043][11550][4.26.14] Exception java.net.ConnectException: Error opening socket to server
/192.168.171.251 on port 50,000 with message: Connection refused (Connection refused).
ERRORCODE=-4499, SQLSTATE=08001
With this test migration I am trying to create a simple table by executing this sql
CREATE TABLE PERSON (
ID INT NOT NULL,
NAME VARCHAR(100) NOT NULL
);
Anyone had this situation and solved it?
I believe that at present there is no support for flyway to work with IBM i (as/400) regardless of whether you use jt400.jar or an IBM jdbc driver.
You can either use a different database-schema versioning tool, or find a fork of flyway that supports i-series (or pay someone to create and support such a fork, it is open source...).
It seems that currently (flyway 7.7.2) does not recognize a URL that starts with "jdbc:as400:" as a Db2 URL, so it throws an exception, which is the reason that the jt400.jar style URL is rejected with exception:
"No database found to handle ..."
The github history tells a story (see: https://github.com/flyway/flyway/issues/105).
Looks like the devs did not succeed to get the AS400 support added due to the lack of a suitable available i-series testing/dev environment (and also available to travis ci) . There may have been at least one PR for such support in the past, although it seems to be removed.
If you try to use the IBM db2jcc4.jar driver to connect to i-series (as400) with a url similar to: jdbc:db2://hostname/dbname, and you explicitly use an IBM jre , and have the relevant license file (e.g. db2jcc_license_cisuz.jar on the CLASSPATH), then flyway will connect and then report the exception similar to:
Unsupported Database: AS 7.4
The flyway source code shows that flyway does not recognize this database product-name and version, at current flyway version 7.7.2.
Are you sure DBDEV is the name of your Db2 data base on the IBM i?
Use the Work with RDB Directory Entry (WRKRDBDIRE) from the green screen, and look for the *LOCAL entry.
Or use the Access Client Solutions (ACS) "Schemas" tool to see a list of DB on your system.
The above shows 2 DB's, UT29p63 and Dbtest

Golden Gate ERROR OGG-05263 No GGSCHEMA clause

In OTN I am using these instructions to "try" and configure GoldenGate with a MSSQL Source DB to an Oracle12c Target DB
http://www.oracle.com/technetwork/articles/datawarehouse/oracle-sqlserver-goldengate-460262.html
Replicating Transactions Between Microsoft SQL Server and Oracle Database Using Oracle GoldenGate
Everything goes okay up till the command:
GGSCI (MSSQL) 2> ADD TRANDATA HRSCHEMA.EMP
Where I get the error:
ERROR OGG-05263 No GGSCHEMA clause was specified in the GLOBALS file. Please specify a GGSCHEMA shema name.
I searched and saw that currently there was no "GLOBALS" file. So I created one:
F:\GG\dirprm\globals.prm
And added one line:
GGSCHEMA hrschema
That did not help.
Still getting the same error.
Any suggestions?
Are there GoldenGate Environment variables that I need to have??
Thank-you in advace for your help.
I got the answer from Oracle Support:
The GLOBALS file should be in the main installation folder. Please remove the same from the dirprm file.
Also the GLOBALS file does not have extension. I could see that you have mentioned it as GLOBALS.prm
Made those changes and it works!

phraseto_tsquery in PostgreSQL 9.5x or just from 9.6x?

I'm finding references in the 9.5 manual to phraseto_tsquery
https://postgrespro.com/docs/postgrespro/9.5/textsearch-controls
But if I use it in my query it gives me this error:
No function matches the given name and argument types.
SELECT phraseto_tsquery('english', 'The Fat Rats');
Was this function not added with 9.5 as intended or is it likely there's some other problem on my side. Running 9.5.4 of the database currently. Anyone that can confirm?
For anyone looking; took the step to install postgresql 9.6beta4 and I'm no longer receiving the error message. In other words phraseto_tsquery seems to only be fully supporting in the current 9.6 beta and upcoming full release.

Enterprise library semantic logging block. SQLDatabase sink. Out of process

I am using Enterprise library semantic logging block (out of process) and using SQL Database sink to dump all the message. After putting everything in place and doing a test run, I am getting the following error - could not find stored procedure 'dbo.WriteTraces'.
Anybody faced similar issue ? Pl suggest.
Out of process semantic logging assembly comes with some powershell scripts and .sql files. We have to edit (to change DB name) and run these scripts. This will generate the stored procs and the associated table for us.
I encountered this same error but it was because we were trying to use a schema other than dbo for our logging database. Once we changed it back to dbo that resolved the problem. We were using the out of process SemanticLogging-svc.exe, which, from what I can tell, assumes that dbo is the schema name.