SQL syntax

2018-03-02 Thread Dale Seaburg
My mind is drawing a blank.  Not sure where to go to find the answer.  
Here is the statement in C#:


sSQL = "SELECT \"Image_Filename\" FROM \"Instruments\" WHERE ";

To finish off the WHERE clause, I need to look at the first 2 letters, 
like "D:".  My question is how do I specify in the WHERE clause, to look 
at the first 2 characters in the Image_Filename column?  What is the 
correct SQL syntax for looking at just a portion of a column?


I feel so dumb...  This can't be that hard, but I am exhausted and 
running out of ideas.  I need someone to give me a boost!  ;-)


Thanks,
Dale.



Strange error in Windows 10 Pro

2018-04-20 Thread Dale Seaburg
I am attempting to install a fresh copy of 
postgresql-9.6.8-2-windows-x86 on a new DELL PC with Windows 10 Pro.  It 
gets near the end of the install when the message says it is attempting 
to start the the database server.   There's a long pause, followed by an 
error message: "Failed to load SQL modules into the database cluster".  
Using File Explorer, i notice the 9.6\base\ folder is empty?  Has anyone 
else seen this before?  I have no clue where to look for the issue.



As a double-check on a different PC with Windows 10 Pro, I get no error 
message, and the database is installed correctly.


Dale Seaburg





Re: Strange error in Windows 10 Pro

2018-04-20 Thread Dale Seaburg
Oops, my mistake.  I'll let this serve the list with what I've tried so 
far.  Thanks, Adrian for the reminder.


I hope tomorrow to visit the customer and try the Admin user method of 
installing.


Dale


On 4/20/2018 11:03 PM, Adrian Klaver wrote:

On 04/20/2018 07:52 PM, Dale Seaburg wrote:

Please also reply to list.
Ccing list to put it front of more eyes.


Thanks, Adrian, for suggestion(s).


On 4/20/2018 9:35 PM, Adrian Klaver wrote:

On 04/20/2018 07:16 PM, Dale Seaburg wrote:
I am attempting to install a fresh copy of 
postgresql-9.6.8-2-windows-x86 on a new DELL PC with Windows 10 
Pro.  It 


This was downloaded from where?
downloaded from https://www.postgresql.org/download/windows/, 
selecting to use the installer pointed to near the beginning of that 
page.  The actual website that contained the installer file was: 
"https://www.enterprisedb.com/thank-you-downloading-postgresql?anid=209611";. 



gets near the end of the install when the message says it is 
attempting to start the the database server.   There's a long 
pause, followed by an error message: "Failed to load SQL modules 
into the database cluster". Using File Explorer, i notice the 
9.6\base\ folder is empty?  Has anyone else seen this before?  I 
have no clue where to look for the issue.


You are running as Admin user?
I can't say that I was.  Will check this next time (maybe tomorrow) 
when I am customer's site.  I didn't even think about right-clicking 
on the installer and selecting run-as-admin.  I know I did not 
deliberately use Admin user on the test PC mentioned below, and it 
installed with no problems.





As a double-check on a different PC with Windows 10 Pro, I get no 
error message, and the database is installed correctly.


Dale Seaburg

















Re: Strange error in Windows 10 Pro

2018-04-21 Thread Dale Seaburg
Thanks Adrian for the suggestion of running the installer with Admin 
rights.  Unfortunately, I get the same results.  It appears that all of 
the folders within C:\Program Files\PostgreSQL\9.6 path are created, and 
populated, BUT, when the items in the *data* folder are to be created, 
or copied into, it leaves an error message as noted previously.  The 
*data* folder is empty.


It's almost as if the PC is missing a critical .dll needed in the *data* 
folder filling function (my guess).


Again, I am at a loss as to what to do.

Dale


On 4/20/2018 11:13 PM, Dale Seaburg wrote:
Oops, my mistake.  I'll let this serve the list with what I've tried 
so far.  Thanks, Adrian for the reminder.


I hope tomorrow to visit the customer and try the Admin user method of 
installing.


Dale


On 4/20/2018 11:03 PM, Adrian Klaver wrote:

On 04/20/2018 07:52 PM, Dale Seaburg wrote:

Please also reply to list.
Ccing list to put it front of more eyes.


Thanks, Adrian, for suggestion(s).


On 4/20/2018 9:35 PM, Adrian Klaver wrote:

On 04/20/2018 07:16 PM, Dale Seaburg wrote:
I am attempting to install a fresh copy of 
postgresql-9.6.8-2-windows-x86 on a new DELL PC with Windows 10 
Pro.  It 


This was downloaded from where?
downloaded from https://www.postgresql.org/download/windows/, 
selecting to use the installer pointed to near the beginning of that 
page.  The actual website that contained the installer file was: 
"https://www.enterprisedb.com/thank-you-downloading-postgresql?anid=209611";. 



gets near the end of the install when the message says it is 
attempting to start the the database server.   There's a long 
pause, followed by an error message: "Failed to load SQL modules 
into the database cluster". Using File Explorer, i notice the 
9.6\base\ folder is empty?  Has anyone else seen this before?  I 
have no clue where to look for the issue.


You are running as Admin user?
I can't say that I was.  Will check this next time (maybe tomorrow) 
when I am customer's site.  I didn't even think about right-clicking 
on the installer and selecting run-as-admin.  I know I did not 
deliberately use Admin user on the test PC mentioned below, and it 
installed with no problems.





As a double-check on a different PC with Windows 10 Pro, I get no 
error message, and the database is installed correctly.


Dale Seaburg




















Re: Strange error in Windows 10 Pro

2018-04-23 Thread Dale Seaburg
Thanks to Moreno and Igor for the Event Viewer suggestions.  Here are a 
few lines of log file where they differ between a good install and a bad 
incomplete install.  The good install was from my Shop PC with Windows 
10 Pro.


BTW, I had success with another Dell PC with Win 10 Pro about 4 months 
ago.  This problem appears to be a one-off.


Good Install:
/Called AclCheck(C:\Program Files\PostgreSQL\9.6\data)//
//Called IsVistaOrNewer()...//
//    'winmgmts' object initialized...//
//    Version:10.//
//    MajorVersion:10//
//Executing icacls to ensure the SHOP-PC\Dale account can read the path 
C:\Program Files\PostgreSQL\9.6\data//

//    Executing batch file 'rad0510A.bat'...//
//    processed file: C:\Program Files\PostgreSQL\9.6\data//
//Successfully processed 1 files; Failed processing 0 files/

Bad Install:
/Called AclCheck(D:\PostgreSQL\9.6\data)//
//Called IsVistaOrNewer()...//
//    'winmgmts' object initialized...//
//    Version:10.//
//    MajorVersion:10//
//Executing icacls to ensure the WINDOWS-6BEGVO1\don king account can 
read the path D:\PostgreSQL\9.6\data//

//    Executing batch file 'rad6DBC7.bat'...//
//
/Notice the last four lines of the *Good Install* vs the last two lines 
of the *Bad Install*.  There is no indication of processing, or whether 
it was successful or not in the bad install.


As you can see, I even took Igor's suggestion to install in a non-system 
(Program Files) path, to no success.


Again, not sure what to do.  Open for suggestions...  I'm almost ready 
to call Dell and complain about a "bad" Win 10 Pro install.


Dale
//
On 4/23/2018 9:54 AM, Moreno Andreo wrote:

Il 21/04/2018 22:35, Adrian Klaver ha scritto:

On 04/21/2018 01:08 PM, Dale Seaburg wrote:
Thanks Adrian for the suggestion of running the installer with Admin 
rights.  Unfortunately, I get the same results.  It appears that all 
of the folders within C:\Program Files\PostgreSQL\9.6 path are 
created, and populated, BUT, when the items in the *data* folder are 
to be created, or copied into, it leaves an error message as noted 
previously. The *data* folder is empty.


It's almost as if the PC is missing a critical .dll needed in the 
*data* folder filling function (my guess).


Again, I am at a loss as to what to do.


Have you looked at the system logs e.g. Event Viewer?


If you look in %temp%", there should be one or more files named 
"bitrock_installer" or something similar (search for "bitrock"), 
that's the setup log with what's went good and what not.
Another hint I had since 9.1 times (it was 2012, I guess) was to avoid 
installing Postgres under system folders (c:\program files, c:\users, 
and so on) because in some cases there could be some nasty 
behaviors... try installing on something like c:\PG96...


HTH
Cheers,
Moreno.-







Re: Strange error in Windows 10 Pro

2018-04-23 Thread Dale Seaburg
As you may have noticed in the Bad Install section, the user's name was 
'don king' - with an embedded space.  I created a new user 'Dale' to 
test out whether that name might be causing a problem.  The new name 
also failed to complete an install.


Dale


On 4/23/2018 9:09 PM, Dale Seaburg wrote:


Thanks to Moreno and Igor for the Event Viewer suggestions. Here are a 
few lines of log file where they differ between a good install and a 
bad incomplete install.  The good install was from my Shop PC with 
Windows 10 Pro.


BTW, I had success with another Dell PC with Win 10 Pro about 4 months 
ago.  This problem appears to be a one-off.


Good Install:
/Called AclCheck(C:\Program Files\PostgreSQL\9.6\data)//
//Called IsVistaOrNewer()...//
//    'winmgmts' object initialized...//
//    Version:10.//
//    MajorVersion:10//
//Executing icacls to ensure the SHOP-PC\Dale account can read the 
path C:\Program Files\PostgreSQL\9.6\data//

//    Executing batch file 'rad0510A.bat'...//
//    processed file: C:\Program Files\PostgreSQL\9.6\data//
//Successfully processed 1 files; Failed processing 0 files/

Bad Install:
/Called AclCheck(D:\PostgreSQL\9.6\data)//
//Called IsVistaOrNewer()...//
//    'winmgmts' object initialized...//
//    Version:10.//
//    MajorVersion:10//
//Executing icacls to ensure the WINDOWS-6BEGVO1\don king account can 
read the path D:\PostgreSQL\9.6\data//

//    Executing batch file 'rad6DBC7.bat'...//
/




Re: Strange error in Windows 10 Pro

2018-05-14 Thread Dale Seaburg

Just to put a finishing note to this thread:

I am placing the blame on the mfg of the PC - was supposed to be a NEW, 
but had a Reburbished sticker on the bottom of the case.  Now, whether 
it was the PC mfg or Microsoft's fault, I really could care less - the 
PC became useless for installing PostgreSQL - versions 8.4.5, 9.6.7 or 
10.3.  The install ALWAYS failed at the very last step - the building of 
the internal folders, etc of the *data* folder.


So, in frustration, I have chosen to install 8.4.5 on an older PC 
running XP.  It just works!  I don't like it, but I am constrained by 
the owner's wishes.


Thanks, for offering each of your individual helps.

Regards,
Dale Seaburg

On 4/21/2018 3:08 PM, Dale Seaburg wrote:


Thanks Adrian for the suggestion of running the installer with Admin 
rights.  Unfortunately, I get the same results.  It appears that all 
of the folders within C:\Program Files\PostgreSQL\9.6 path are 
created, and populated, BUT, when the items in the *data* folder are 
to be created, or copied into, it leaves an error message as noted 
previously. The *data* folder is empty.


It's almost as if the PC is missing a critical .dll needed in the 
*data* folder filling function (my guess).


Again, I am at a loss as to what to do.

Dale


On 4/20/2018 11:13 PM, Dale Seaburg wrote:
Oops, my mistake.  I'll let this serve the list with what I've tried 
so far.  Thanks, Adrian for the reminder.


I hope tomorrow to visit the customer and try the Admin user method 
of installing.


Dale


On 4/20/2018 11:03 PM, Adrian Klaver wrote:

On 04/20/2018 07:52 PM, Dale Seaburg wrote:

Please also reply to list.
Ccing list to put it front of more eyes.


Thanks, Adrian, for suggestion(s).


On 4/20/2018 9:35 PM, Adrian Klaver wrote:

On 04/20/2018 07:16 PM, Dale Seaburg wrote:
I am attempting to install a fresh copy of 
postgresql-9.6.8-2-windows-x86 on a new DELL PC with Windows 10 
Pro.  It 


This was downloaded from where?
downloaded from https://www.postgresql.org/download/windows/, 
selecting to use the installer pointed to near the beginning of 
that page.  The actual website that contained the installer file 
was: 
"https://www.enterprisedb.com/thank-you-downloading-postgresql?anid=209611";. 



gets near the end of the install when the message says it is 
attempting to start the the database server.   There's a long 
pause, followed by an error message: "Failed to load SQL modules 
into the database cluster". Using File Explorer, i notice the 
9.6\base\ folder is empty?  Has anyone else seen this before?  I 
have no clue where to look for the issue.


You are running as Admin user?
I can't say that I was.  Will check this next time (maybe tomorrow) 
when I am customer's site.  I didn't even think about 
right-clicking on the installer and selecting run-as-admin.  I know 
I did not deliberately use Admin user on the test PC mentioned 
below, and it installed with no problems.





As a double-check on a different PC with Windows 10 Pro, I get no 
error message, and the database is installed correctly.


Dale Seaburg






















View Filtered Rows technique

2018-05-19 Thread Dale Seaburg
I am looking for a convenient way to search a specific table where a 
specific column contains a string like this: "\2016\    \" (within the 
quote-marks, but not including the quote-marks).  I haven't found 
anything in the documentation (8.4.5).  I am using the View Data | View 
Filtered Rows method.  I was hoping there might be a 'CONTAINS' clause 
that would do the trick.  Any clues or help is appreciated.


Dale




Windows XP to Win 10 migration issue

2017-12-09 Thread Dale Seaburg
I have a database in Windows XP (old PC), postgresql 8.4.5 which needs 
to be migrated to Windows 10 Pro (new PC).


Now, for the bad news, the XP PC, when I powered down, before doing any 
backup or database unload, would not power back up.  I will be 
attempting to get the PC fixed for that.  In the meantime, I removed the 
old PC HD, installing in a SATA to USB box and I installed the same 
version of Postgresql (8.4.5) on the Win 10 machine, thinking I could 
simply copy the data folder from the XP's HD to the Win 10's HD into the 
appropriate folder (C:/.../8.4.5/).  I did the copy of the data folder, 
after renaming the new, unused data folder to preserve it).  I stopped 
the postgres service, made the copy, and attempted to restart the 
postgres service.  No Go!  Would not start.  As a double-check, I 
renamed the copied data folder to something else and renamed the 
preserved data folder back to it's original name, and the service 
restarted just fine.


So, without being able to backup or unload (dump?) the original database 
on the original PC, what would be the best way to move data to the new 
PC?  Or, IS there any way to do this, without reviving the old XP, PC?


Dale



Error creating a table

2018-01-02 Thread Dale Seaburg

I am in pgAdmin, attempting to create a table in an existing database.
This table is normally created and deleted by software I have written (C#).
I get this kind of error when executing the CREATE TABLE script (which 
is a copy of similarly named table):


NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 
"public_rowkey" for table "ABSTRACT-SERVER_runsheet"


ERROR:  relation "public_rowkey" already exists

** Error **

ERROR: relation "public_rowkey" already exists
SQL state: 42P07

I have looked for rowkey in the "public" schema, but find nothing.
What can be the problem?  What might I be doing wrong?  I'm not sure 
what to do.


Dale




Windows 10 Pro issue

2018-02-13 Thread Dale Seaburg

Server:  Windows 10 Pro system
Postgresql:  8.4.5 installed several months ago and working correctly, 
until recently


On Feb 9, 2018 about 7 PM pg_log file recorded:

2018-02-09 15:04:23 CST LOG:  unexpected EOF on client connection
2018-02-09 19:12:41 CST LOG:  received fast shutdown request
2018-02-09 19:12:41 CST LOG:  aborting any active transactions
2018-02-09 19:12:41 CST LOG:  autovacuum launcher shutting down
2018-02-09 19:12:41 CST LOG:  shutting down
2018-02-09 19:12:43 CST LOG:  database system is shut down

On Feb 12, 2018 about 2 PM after computer was restarted, pg_log file 
recorded:


2018-02-12 14:17:31 CST LOG:  could not open configuration file 
"C:/WINDOWS/system32/ConfigDir/pg_hba.conf": No such file or directory

2018-02-12 14:17:31 CST FATAL:  could not load pg_hba.conf

The log event on Friday, appears to have recorded a forced shutdown - 
Windows 10 update install, maybe?  No one at business to record what may 
have happened.


On Monday afternoon, postgres service refused to Start as indicated in 
that day's log event.


Any ideas as to what might have happened, or caused this anomaly? It's 
almost as if some Environment Variables were missing, or scrambled.  I 
don't think Postgresql uses the Windows Registry, in place of EV's, does it?


Dale Seaburg