Re: Sub:column "" is of type bigint but expression is of type character varying

2022-08-17 Thread JITEN KUMAR SHAH

1. Please check you tickets_archive.ticket_purchase_no data type.

2. check if you are using correct schema.


On 8/17/22 14:23, Rama Krishnan wrote:

Hi All,

I am having table name called tickets


\d tickets

            Column            |     Type             | Collation | 
Nullable | Default

--+-+---+--+-
 id                           | bigint                     |   | not 
null |
 ticket_purchase_no| bigint          |                        | not 
null |


this below table contains more than 2 years old data
\d tickets_archive

            Column |            Type             | Collation | 
Nullable | Default

--+-+---+--+-
 id                           | bigint                      |         
          | not null |

 ticket_purchase_no| bigint                  |         | not null |




i have purged the old data from orginal table when i am restoring the 
data from archive table into orignal table i am getting the error



*insert into tickets select * from tickets_archive;*


 column "*ticket_purchase_no*" is of type bigint but expression is of 
type character varying

Regards

A.Rama Krishnan


Re: Creating constraint dynamically

2022-08-22 Thread JITEN KUMAR SHAH




On 8/22/22 13:09, Wim Bertels wrote:

sivapostg...@yahoo.com schreef op ma 22-08-2022 om 07:29 [+]:

ALTER TABLE public.tx_barcode_stock
ADD CONSTRAINT "tx_barcode_stock_CK1" CHECK
( (branchcode = '1'::bpchar  and barcodeitem = 'Y'::bpchar and
closingstock >= 0::numeric)  Or (branchcode = '1' and barcodeitem =
'N'::bpchar and closingstock >= 0::numeric )  Or (branchcode =
'2'::bpchar  and barcodeitem = 'Y'::bpchar and closingstock >=
0::numeric)  Or (branchcode = '2' and  barcodeitem = 'N'::bpchar and
closingstock >= 0::numeric ) ) NOT VALID;

After creation, when we check what we find is  [ in PgAdmin ]
ALTER TABLE public.tx_barcode_stock
     ADD CONSTRAINT "tx_barcode_stock_CK1" CHECK (branchcode::bpchar =
'1'::bpchar AND barcodeitem = 'Y'::bpchar AND closingstock >=
0::numeric OR branchcode::text = '1'::text AND barcodeitem =
'N'::bpchar AND closingstock >= 0::numeric OR branchcode::bpchar =
'2'::bpchar AND barcodeitem = 'Y'::bpchar AND closingstock >=
0::numeric OR branchcode::text = '2'::text AND barcodeitem =
'N'::bpchar AND closingstock >= 0::numeric)
     NOT VALID;

We have only one bracket, in the final updated one.

Since there are AND and OR conditions, without brackets the whole
conditions becomes useless.

did you see
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-PRECEDENCE
?


mvg,
Wim


You can use plpgsql function
alter table tale_name add constraint xyz  check (func(table_name))





Re: 10.22 Windows binaries download? (zip "invalid" on Enterprisedb)

2022-09-21 Thread JITEN KUMAR SHAH
Few days before one of the user having same issue and they find out it 
was some file name issue


Link of email:
https://www.postgresql.org/message-id/CA%2BRCjax7d3djH6YMRb9bnHzmtz6hFhexq9YsYbtYdeOVUwh5%2BQ%40mail.gmail.com


On 9/21/22 20:57, Thomas, Richard wrote:

Thanks very much - 7-zip (from https://www.7-zip.org/) was just the job to unpack the 
archive where Windows "Extract all" failed.

Richard


-Original Message-
From: Erik Wienhold 
Sent: 21 September 2022 14:44
To: Thomas, Richard ; pgsql-
gene...@lists.postgresql.org
Subject: Re: 10.22 Windows binaries download? (zip "invalid" on Enterprisedb)


On 21/09/2022 15:34 CEST Thomas, Richard

 wrote:

I’m trying to download the Windows x64 binaries only for PostgreSQL 10.22 in

order to perform a minor upgrade. However, the download
(https://urldefense.com/v3/__http://postgresql-10.22-1-windows-x64-
binaries.zip__;!!OepYZ6Q!8OcLEO8KpfZpItfLWpOliejGRWOyHm9zuZBvTxc6ifxC
c7xA5i3TOGADp-wurt7EIz-8Z3QQj5_0fmh2l21mMw$  ) from my usual go-to
place: (https://urldefense.com/v3/__https://www.enterprisedb.com/download-
postgresql-
binaries__;!!OepYZ6Q!8OcLEO8KpfZpItfLWpOliejGRWOyHm9zuZBvTxc6ifxCc7x
A5i3TOGADp-wurt7EIz-8Z3QQj5_0fmjyao_6kg$  ) gives me a file that Windows
zip declares invalid.

There's already a thread on that issue:

https://urldefense.com/v3/__https://www.postgresql.org/message-
id/flat/CA*2BRCjaw*3DGH-Lyxe5*3D5-un6sQjO-
cQjhTeBDomiXoWQDrvVYwxA*40mail.gmail.com__;JSUlJQ!!OepYZ6Q!8OcLEO
8KpfZpItfLWpOliejGRWOyHm9zuZBvTxc6ifxCc7xA5i3TOGADp-wurt7EIz-
8Z3QQj5_0fmhPwsTSbA$

--
Erik

At Atkins - member of the SNC-Lavalin Group, we work flexible hours around the 
world. Although I have sent this email at a time convenient for me, I don't 
expect you to respond until it works for you.
NOTICE – This email message and any attachments may contain information or 
material that is confidential, privileged, and/or subject to copyright or other 
rights. Any unauthorized viewing, disclosure, retransmission, dissemination, or 
other use of or reliance on this message or anything contained therein is 
strictly prohibited and may be unlawful. If you believe you may have received 
this message in error, kindly inform the sender by return email and delete this 
message from your system. Thank you.






Re: Re-2: New to PostgreSQL - looking for query writing tools

2023-02-02 Thread Jiten Kumar Shah
You can try https://github.com/OmniDB/OmniDB is not active but it is 
working and also available in postgres debian repo


On 2/2/23 13:38, Brent Wood wrote:

The free version of Valentina Studio and DBeaver are the two I prefer

If you use Postgis for spatial data, DBeaver understands geometry data 
& can display data on a simple map or as tabular output, with a built 
in Leaflet facility.


https://valentina-db.com/en/studio/download
https://dbeaver.io/


Brent Wood


*From:* Sacha Kerres
*Sent:* Thursday, February 02, 2023 20:51
*To:* Giovanni Biscontini; pgsql-general@lists.postgresql.org
*Subject:* Re-2: New to PostgreSQL - looking for query writing tools

Hi,
we use sqlmanager.net tools:  Query, DBCompare, Data Compare, 
Automatic Tasks, Backup+Restore, etc...


There is a free version, but for professional work, you have to buy a 
license. But there is only a windows version.


Mit freundlichen Grüßen
Sacha Kerres
Kerres-EDV Beratung
Deglhof 45-47
93142 Maxhütte-Haidhof
Tel. +49 9471 60 14 14
Mobil. +49 171 210 48 46
E-Mail. sker...@kerres-edv.de

Original Message processed by david® 

*Re: New to PostgreSQL - looking for query writing tools* 2.
Februar 2023, 08:34 Uhr
*Von*   Giovanni Biscontini 
*An*pgsql-general@lists.postgresql.org

Hi Troy,
 we both use pgAdmin4 and DBeaver (https://dbeaver.io/) Community
version but mainly 'cos we need to get in control of other
functions of the database server, query is only a part of the job.
Another interesting tool is Aquafold (https://www.aquafold.com):
Aqua Data Studio is interesting (only tested) but it's a bit pricey...
Hope it helps, bye Giovanni

Il giorno mer 1 feb 2023 alle ore 18:00 Robin Tang
 ha scritto:

There's a bunch listed here:
https://wiki.postgresql.org/wiki/PostgreSQL_Clients

I personally use Postico, but it's only available on Mac.

On Wed, Feb 1, 2023 at 8:43 AM Troy Sherven 
wrote:

Good morning,

First of all, I am not a database professional.  I work
for a small company, and a portion of my job includes
report writing (crystal, i-Net, etc), Excel analysis,
etc.  We recently migrated to a new ERP that runs on a
PostgreSQL database.  Our previous system was on a MSSQL
database.  I have fairly basic experience writing SQL
queries.  In the past I would use Microsoft SQL Server
Management Studio to help in writing my SQL queries (I’d
use the diagram, criteria, and SQL panes) instead of just
writing SQL statements.

I’m looking for recommendations of tools that would work
similar to Microsoft SQL Server Management Studio.  So far
I’ve played around with pgAdmin (doesn’t seem to have the
same query writing abilities) and EMS SQL Query (seems
more cumbersome than the Microsoft tool).  Are there any
other tools I should be looking at for query writing help?
I like to something visual and a grid to help write queries.

Any recommendations would be appreciated!

Troy



--

*Cordiali Saluti*


***Dott. Giovanni Biscontini*

* [Divisone Software]*

***Str. Ponte Alto Sud, 74
  41123 Modena  (MO)*

Phone: 059_452094
  Fax: 059_8672171
  E-mail: biscontin...@es2000.it

 Skype: g.biscontini.eurosystem2000

WEB: https://www.es2000.it 



Privacy e riservatezza: il presente messaggio, così come i
relativi allegati, contengono dati ed informazioni da considerarsi
strettamente riservate ed è indirizzato esclusivamente al
destinatario sopra indicato, il quale è l'unico autorizzato a
trattarlo in osservanza delle norme del Regolamento UE 2016/679
(RGPD) . Preghiamo chiunque ricevesse questo messaggio per errore
di evitare di copiarlo, divulgarlo, distribuirlo a terzi e di dare
notizia al mittente dell’errato invio, distruggendone poi
l'eventuale copia cartacea e la copia in formato elettronico.

Il titolare dei dati potrà esercitare tutti i diritti di cui
all'art.7 del suddetto decreto tra cui quelli di accesso,
rettifica, aggiornamento, opposizione al trattamento e cancellazione

*Please, print this e-mail only if necessary*



To: biscontin...@es2000.it
pgsql-general@lists.postgresql.org
  Brent Wood
Principal Technician - GIS and Spatial Data Management
Programme Leader - Environmental Information Delivery
+64-4-386-0529

National Institute of Water & Atmospheric Research Ltd (NIWA)
301 Evans Bay Parade Hataitai Wellington New Zealand
*Connect with NIWA:* niwa.co.nz  Fa