Click here to Skip to main content
15,891,431 members
Everything / Database Development / PostgreSQL

PostgreSQL

PostgreSQL

Great Reads

by Evoluteur
Generic REST or GraphQL endpoints for CRUD and more, written in JavaScript, using Node.js, Express, and PostgreSQL
by RickZeeland
PostgreSQL notifications Windows Forms application
by Arthur V. Ratz
Create a Python web-app using Flask and PostgreSQL server, and run it in Docker
by dsuryd
Combine PostgreSQL logical replication feature with dotNetify to broadcast data changes to your website in real-time

Latest Articles

by GabrieleTronchin
A simple implementation of MartenDB. MartenDB is a .NET Transactional Document DB and Event Store on PostgreSQL. For more information about MartenDB
by Farzad Niknam B
Web app creation using .NET 7.0 and ASP.NET Core
by JBartlau
This article demonstrates how Report Server offers a distribution of reports that save time, increase efficiency, and reduce potential errors.
by Jeffrey T. Fritz
Migrate Azure Postgres database to a Flexible Server

All Articles

Sort by Updated

PostgreSQL 

8 Nov 2011 by #realJSOP
Your DLLs don't need to be put into the GAC. Just add references to them in your project, and you should be able to use the classes in them.
27 Mar 2019 by #realJSOP
A simple google search resulted in this: SELECT table_to_xml('users', true, false, ''); --Or SELECT query_to_xml('SELECT * FROM users', true, false, ''); I leave you to your mad google skillz if this isn't sufficient to get you started.
17 Apr 2019 by #realJSOP
Seriously, dude. How can you NOT help but find something "appropriate": PostgreSQL: Documentation: 9.1: Date/Time Types[^] Date and Time Data Types and Functions (Transact-SQL) - SQL Server | Microsoft Docs[^]
4 Feb 2015 by /\jmot
trySELECT * INTO TouchPOS FROM EssaePOSref.http://www.postgresql.org/docs/9.1/static/sql-selectinto.html[^]if you want to copy a specific column set then into in not applicable.see...
25 Oct 2020 by 2 7182818
With long and painful researches i decided to use session based authentication. I am developing an Web application with .Net core as backend and React js as frontend. I recently swap Node js backend to .Net Core. I am using PostgreSQL as my...
18 Mar 2013 by _Maxxx_
Purely a guess as I don't know the technology, but have you tried setting the SQLType as bit even though the real column is int?
21 Jun 2021 by a_horse_with_no_name_2
i have a table and i want to find out first non-existing date starting from now() to now()+30days. lets assume today is 21. >| userId | dates | | 1 | 2021-06-22 00:00:00| | 1 | 2021-06-24 00:00:00| | 2 | 2021-06-21...
12 Jun 2016 by aarif moh shaikh
Here is two way to resolve your problem .1. You can use the EXCEPT or INTERSECT set operators for this. for example SELECT id, name FROM master.dbo.testEXCEPT -- or INTERSECTSELECT id, name FROM test.dbo.testings2. Use of Information Schema select * FROM questions_table...
12 Feb 2013 by Aarti Meswania
Hello Experts,Is postgre database require any setup at client-side Like SQL-server?I want to bind postgrey database with .net windows application.Happy Coding!:)
5 Mar 2013 by Aarti Meswania
1.migrate from SQLite to PostgresSQL through .net & Nhibernate will require change in queries and datatypes of properties in visualstudio?2.SQLLite to Postgres I have change datatypes in databasesqlite -> postgres---------------------datetime timestampblob byteais it...
18 Mar 2013 by Aarti Meswania
I have application in nhibernate & postgresqlmigrating from sql to postgresin postgres column type is integer but It gives error while update-insert data[Property] [Column(1, Name = "is_deleted", SqlType = "INTEGER")] public virtual bool IsDeleted { get { return...
11 Apr 2013 by Aarti Meswania
this is my postgres table CREATE SEQUENCE student_id_seq;CREATE TABLE student( id integer NOT NULL default nextval('student_id_seq'), first_name character varying, CONSTRAINT student_pkey PRIMARY KEY (id ))WITH ( OIDS=FALSE);ALTER TABLE student OWNER TO...
11 Apr 2013 by Aarti Meswania
I have solve thishope it will useful to them who facing same problem...[Class(Table = "student")]public class Student{ private long _id; private string _studentname;[Id(Name = "Id", Column = "id", UnsavedValue="0" )] [Generator(1, Class = "sequence")] ...
11 Apr 2013 by Aarti Meswania
Hello expertsIf you have experience to install PostgresSQL silently using NSIS please help.
21 May 2013 by Aarti Meswania
visit link...http://stackoverflow.com/questions/13122862/yet-another-stored-procedure-syntax-error-if-then-else[^]Try this...IF flag = 'A' THEN SELECT Count(*) FROM population WHERE incomein(1,2) AND statecode='07';ELSEIF flag = 'B' THEN SELECT Count(*) FROM...
25 Aug 2013 by Aarti Meswania
try this...Select p.* from persona p where p.firstname like CONCAT('%', ? ,'%')Happy Coding!:)
23 Feb 2014 by Abhinav S
If you want a logging utility that tracks code errors, warnings etc, use log4Net - log4net Tutorial[^].There are, of course, other tools available as well.
31 Aug 2015 by Abhinav S
Taken from Postgresql exception-catching rocks! [^] -begin try begin transaction -- alter table z drop column aaa; alter table z add zzz int; commit tran;end trybegin catch print 'hello'; SELECT ERROR_NUMBER() as ErrorNumber, ...
26 Jan 2020 by Accuracy-Global
Hi am using below code to take automatic postgres database @ECHO OFF @setlocal enableextensions @cd /d "%~dp0" SET PGPATH=C:\"Program Files"\PostgreSQL\11\bin\ SET SVPATH=E:\ SET PRJDB=postgres SET DBUSR=postgres FOR /F "TOKENS=1,2,3 DELIMS=/ " %%i IN ('DATE /T') DO SET d=%%i-%%j-%%k FOR /F...
10 Sep 2014 by Afzaal Ahmad Zeeshan
You need to develop a logic to determine what type of user has logged in, inside your Database create a new column, to save whether the user is a teacher or a student. It can be a single Bit column, with name of IsTeacher, and you can save 1 if the user is a teacher or 0 if the user is a...
13 Aug 2015 by Afzaal Ahmad Zeeshan
If I am not missing anything that is a VB service, defined under Microsoft.VisualBasic.ApplicationServices[^], not an MVC one. However it is indeed executed like this, User.IsInRole(string)[^].You can consider using the Authorize attribute and pass the role to it,...
7 Dec 2016 by Afzaal Ahmad Zeeshan
Push notifications are specific to your web development framework. Because it is the server maintaining an open port for pushing the notification to client. On simple web interface, ASP.NET SignalR is enough and you can use JavaScript to handle new messages. What you need is already solved...
20 Feb 2023 by Agnib Pyne 2022
Hi All, I have developed a web application using .Net Core API, Angular and PostgreSQL. Also, a whatsapp chatbot has been developed using Python, Twilio and MongoDB. Now, I want to deploy these for client use and planning to host these in...
15 Dec 2019 by Ahmed Bouchefra
A Django 2 CRUD example application using generic class based views using the latest Python 3.7 version
23 Jan 2012 by Ahn_7
Hi All, I'm a beginner in PostgreSQl and I have some doubts regarding "using scripts in PosrgreSQL"..I'm using visual studio as my GUI coding part concern and from there I'm accessing the PostgreSQL commands..But now I need to create databases, tables etc.. through scripts..Give me...
24 Jan 2012 by Ahn_7
Hi CP, Can anyone paste the scripts using text file..Any psql commands in a text file..Just a basic start to write scripts..Please clear me this issue...
29 Jan 2014 by Ahsann90
You need to join the tables to get the result. In the above given data, there is no date where all three tables have same matching date.select ISNULL((sum(r.received_amount) + sum(t.bill_net_total) - sum(p.paid_amount)),0) as petty_cashfrom tbl_recieved r inner join...
4 Sep 2011 by Ajain A K
Hi,I want give the following connection string to my c sharp code for postgre sql connection but I dont know how to take login information of my postgre sql, I have installed postgre sql 8.4 and EMS data managment in my PC and I am working with EMS for postgre sql management, as I said...
19 Sep 2011 by Ajain A K
Hi, I am working with EMS (SQL Manager for Postgre Lite), I have excecuted a password reset query after that I cannot delete or create any data base, what to do? somebody please help me to solve this issue. Following error is coming every time"Password authentication failed for user".
20 Sep 2011 by Ajain A K
Hi,I am working with postgre SQL, I want to find the User ID of my database for c-sharp database connectivity using connection string. As I havn't used this DB for a long time I forgot the UserID and other DB account details, can anyone help me how to retrive the user ID? Is there any query...
28 Feb 2017 by aks14
Check the export the same location as postgres data available, i.e postgres/data.COPY Table_Name TO '/home/postgres/data/table_data_export.csv';Here Table_name: exportingtable name Path: location of greenplum/data
17 Jan 2017 by Alessio.NET
Saying "How to connect postgres data base in javascript" do you mean that you want to connect to a Postgres DB in a Node.js application?If the answer is yes you should try a module like https://github.com/brianc/node-postgres. The github page is full of documentation on how to import and use it
11 Jul 2016 by Alex Glaros
Verbose works in binary modepg_restore --host=localhost --create --clean --verbose --password --disable-triggers --username=postgres -d pg_for_es3 C:\alex\w2p_stor\pg_alex_binary_backup_20160710.sqlHow to get it to work in text mode? (Can you please type out the whole complete line...
22 Sep 2011 by AlexBanu
HyIf we talk about an windows that host your postgresql you will find the an system account postgres or postgresql an you can reset your login password from there.
20 Mar 2017 by AlexeyYakovlev
A library to emulate Oracle-style permanent temporary tables in the PostgreSQL database
9 Mar 2011 by Amit Kumar Tiwari
Entity framework is the best thing to work with. It is very powerful in itself, following RDBMS and taking care of cardinalities, constraints and validations. It generates entity classes and everything you need for getting started with DB development.Best part is using the Entity framework...
1 Mar 2016 by amit.agarwal8609
You can declare the variable by the following line in your procedure/function. DECLARE variablename integer;DECLARE variablename character varying;
13 Sep 2012 by AmitGajjar
Hi,Have you tried googleing ?Here is SQL Server recursive function example,SQL Server Recursive Function[^]Postgree example,Recursive function in Postgree SQL[^]Hope you got the idea,
16 Jan 2012 by Amund Gjersøe
I've used the ODBC driver when generating DataSets in Visual Studio 2010 multiple times, but this time it all went wrong. The table in the DB has a set of columns defined as numeric(7,2). I try to insert data through the autogenerated Insert method like this:int x =...
16 Jan 2012 by Amund Gjersøe
Lol, things work in mysterious ways!It turns out that to get the Postgres ODBC driver to work properly I had to read from the table before inserting data into it. In all other applications I did read from the DB as well as write. In my current application I only write, and that was the...
4 Sep 2019 by Anand Navale
You need to call DataBind() function while saving,updating or deleting data. like DropDownList.DataBind(); To get more reference Have a look there HierarchicalDataBoundControl.PerformDataBinding Method (System.Web.UI.WebControls) | Microsoft Docs[^] BaseDataBoundControl.DataBind Method...
14 Feb 2023 by Andre Oosthuizen
$conn has never been declared, it should be $pdo, which has been declared, as per your function.
11 Apr 2024 by Andre Oosthuizen
Based on the comments and Pete's solution - -Everything depends on whether you have a relation between the 2 tables - Primary and Foreign keys, in your case the 'building_id'. from both tables. -Store the values as a '0' which will return a false...
8 Oct 2015 by Andrew Budiman
here i got an example for the table TABLE =====id_user | equity | schedule123 | 2000 | 2015-09-29124 | 2000 | 2015-09-29125 | 2000 | 2015-09-29126 | 2000 | 2015-09-29127 | 2000 | 2015-09-29123 | 3000 | 2015-09-28124 | 3000 |...
9 Oct 2015 by Andrew Budiman
what if the scenario become like this, id_user | equity | schedule123 | 2000 | 2015-09-29124 | 2000 | 2015-09-29125 | 2000 | 2015-09-29126 | 2000 | 2015-09-29127 | 2000 | 2015-09-28123 | 3000 | 2015-09-28124 | 3000 | 2015-09-28125 | 1000 | 2015-09-28126 | 1000 |...
26 Oct 2015 by Andrew Budiman
hi everybody here,i wanna ask about a big data using postgresql and using EJB(jboss) as the remote bean, also as the webserver i'm using tomcat and pure html+jsp(JSON).let's say in a month i'm gonna have 10000 rows of data, so if i'm query it for 1 day, it gotcha be 100 rows, and it's...
21 Sep 2011 by André Kraak
If you are trying change the due_date field you should be using an update[^] statement.
19 May 2022 by André Marcos (Advisor), GracianoSouza
React Native, Node.js and PostreSQL, a PERN stack to develop an app to support the lost pets searching process
27 Jul 2017 by Annu Ranjan
I have a variable of type Boolean in my entity class by name "isActive". It to mapped to a column by name "is_active" with data type as bit. @Column(name = "is_active") private boolean isActive; But when ever I try to save isActive attribute of the object, I get an error: column "is_active"...
21 May 2013 by Anusha Srivastava
I am very new to PostgreSQL and i am trying to make a function in this but it's showing syntax errorCREATE OR REPLACE FUNCTION master.test(tehsil text, district text, state text,flag text) RETURNS SETOF refcursor AS $BODY$DECLARE recordSet refcursor; BEGIN ...
21 May 2013 by Anusha Srivastava
CREATE OR REPLACE FUNCTION master.test2(tehsil text, district text, state text, flag text) RETURNS setof master.population AS$BODY$BEGIN IF flag='A' THEN select Count(*) from master.population where income in('1','2')and statecode=state; ELSIF flag='B' THEN select...
5 Jun 2013 by Anusha Srivastava
I am trying to build a function which check for the schema and table in database if present then select the table values else create that schema and table and passing schema and table name as parameters of a function. CREATE OR REPLACE FUNCTION master.chkbypram(schemaname text,state...
5 Jun 2013 by Anusha Srivastava
i solved it like this: CREATE OR REPLACE FUNCTION master.test2(tehsil text, district text, state text, flag text) RETURNS int AS $BODY$ BEGIN Declare ione int; IF flag='A' THEN select COALESCE (Count(*))into ione from master.population where income...
28 Oct 2013 by Aravind Garre
Hi Developers, i am inserting values into postgreSQL tables using functions, its inserting but i am getting result -1 Why it is coming -1 it should come greater then 0 right.please help me in this.PgsqlCommand.Executingnonquery();==-1 is coming after inserting.Sorry for the grammer...
24 Mar 2021 by Arctype SQL
Using pg_notify in Postgres alongside the NOTIFY and LISTEN syntax is all that's needed to build a real time updating dashboard
24 Mar 2021 by Arctype SQL
Universally Unique IDs (UUIDs) use random numbers to create unique IDs. UUIDs use more storage, but they provide a good solution for distributed databases and security.
9 Apr 2021 by Arctype SQL
Explanation of how a query gets execution and understanding the EXPLAIN command
1 Dec 2021 by Arctype SQL
In this article, you'll learn about Postgres UUIDs and how to generate them with examples from two different modules.
31 Mar 2021 by Arctype SQL
Easily deploy PostgreSQL pod in Kubernetes
24 Aug 2018 by Arthur V. Ratz
Create a Python web-app using Flask and PostgreSQL server, and run it in Docker
14 Aug 2019 by ashishsri
We have data in serialized form of binary.Now we have to store it in PostGre database. For insertion , we had stored the code in data column of bytea . And use the following code:using (FileStream pgFileStream = new FileStream("F:\\Test.abc", FileMode.Open, FileAccess.Read)) { ...
14 Sep 2018 by Ashok Borate
Please check if you are initializing Identity provider with Role services.AddIdentity() .AddEntityFrameworkStores() .AddDefaultTokenProviders(); Please note that AddDefaultIdentity...
16 Sep 2013 by ashwani 12
how can we create report without using crystal report in visual studio 2010 with postgresql ?(in asp.net)
1 Aug 2013 by askquez
There is string arrayARRAY['CAT','CAT DOG CAT','DOG Cat']Now i want to sort this array on count of words in each element. I have tried but cannot get any success.I want this outputARRAY['CAT DOG CAT','DOG CAT','Cat']How i can do this?
16 Mar 2014 by askquez
i am newbie to django and developing rest api using Django rest framework gis. Previously i was using sql query for transform geometryselect id,name,round(value::numeric,2) as value, st_transform(geometry, 3857) as geometry from my_modelclass MyModel(models.Model): name =...
25 Jul 2013 by Avinash502
I need to drop my postgreSQL Database from my windows application.But,If Clients are connected to that Database It throws exception.In postgreSQL 9.1 pg_terminate_backend() is working for disconnect all active connections before drop my database but,i need to done same thing in Postgres 8.0...
12 May 2014 by Avinash502
I have data in datatable with the same structure of table to be inserted into the postgresSql.So,How can i insert data directly from datatable or dataset to the table postgresSql
20 Jun 2012 by b.b 22
could you tell me how do i import a database from Postgresql to SQL Server 2008?
13 Jun 2014 by bcasillas
HiI have a table like thisid | park | visitors | date1 | 1 | 20 | 1/1/20142 | 2 | 20 | 1/1/20143 | 3 | 15 | 1/1/20144 | 4 | 13 | 1/1/20145 | 5 | 45 | 1/1/20146 | 1 | 20 | 1/1/20147 | 2 | 20 | 1/1/20148 | 3 | 15 | 1/1/20149 | 4 | 13 | 1/1/201410 | 5 | 45...
21 Jan 2013 by Bernhard Hiller
These items are used for automatically generating ID numbers.In old style database (e.g. Oracle), you define the ID column as a number, create a sequence, and a trigger which links the ID column of the table with the sequence such that the column gets the next value from the sequence when a...
17 Feb 2014 by Bhagyashree Chaudhari - Member 10473634
I want to use Entity Frame work and back end will be Postgresql .When i choose model.edmx file and than select "Generate from Database" i can't find Postgresql , i just get sql (4 option , but 4 have SQL), i want to do for postgre sql (whatever we can do with SQL Server , i want to do with...
21 Feb 2014 by Bhagyashree Chaudhari - Member 10473634
want provider for postgresql.when i create modeldata.edmx file, it ask for me for database, and i clicked on generate from database than click on new connection , and i got only sql providers i want provider for postgresql.Is there any let me know as you can post .Thank u.
9 Sep 2014 by Bhagyashree Chaudhari - Member 10473634
Good Afternoon ,I want to make web api , which will be in my existing " WEB FORM Application " and i want to GET , POST my data in database ( POSTGRESQL ).First , when user click on my webapi url , it will ask for client certificate if its valid (till here done ) then user can GET and POST...
19 Apr 2015 by Bhagyashree Chaudhari - Member 10473634
You should try thisSELECT bill_no, sum(amount) as net_total FROM tbl_transaction_masterWHERE bill_date >='2014-12-23 00:00:00' AND bill_date
23 May 2017 by Bhavikkumar Chaudhari
I have a function(stored procedure) which returns refcursor from postgresql function I want to fill classic asp recordset from the result of refcursor. PGSQL - Function CREATE OR REPLACE FUNCTION getlisttest(IN i_list text, retcur refcursor) RETURNS refcursor AS $BODY$ BEGIN IF i_list...
1 Feb 2015 by Black_Rose
Hi allbill_no datetime amount1; "2014-12-23 17:36:07"; 382.021; "2014-12-23 09:08:37"; 1452.382; "2014-12-23 18:18:26"; 472.992; "2014-12-23 09:56:44"; 380.953; "2014-12-23 10:00:07"; 666.673; "2014-12-23...
2 Feb 2015 by Black_Rose
Hi allwhen i am writing select * from table_name, it is taking only the unique bill_no's and returning the values.please tell me how to write a query where it will take all the values from the table even if there is duplicate bill_no also.Note: bill_no is not primary key
8 Feb 2015 by Black_Rose
Hi allI have 2 database in my system PostgreSQL ver 9.11)EssaePOS2)TouchPOSI want to copy all the data from EssaePOS one table to TouchPOS another table.the table name and number of column is same for both the database.I searched google.got something called pg_dump but not...
8 Feb 2015 by Black_Rose
Hi allPlease tell me how to take backup of a remote ubuntu postgresql and copy backup file in local windows system.Thank you
1 Mar 2015 by Black_Rose
Hi allI have a table which contains around 7000+ data.now i want to add a unique id column on the existing data and also later if user addsany records, it should increment automatically.e.g. Below is the existing data1 name 541 name 502 age 883 place...
3 Mar 2015 by Black_Rose
Hi allI have date in my database with datetime.02-02-2015 20:15:49I want to remove the time part from all the records.Please tell me the way to do that.
5 Mar 2015 by Black_Rose
Hi allI have a table where parcel value (double) for 2 months data some how didn't saved.so the column is displaying blank.I want to update those places with 0.00Please tell me how to do this.I tried below query but it's not effecting any row.update tbl_transaction_master set...
31 Oct 2015 by Blake Peeling
Hey guys, I am running into an issue when I try to set up a domain with a CHECK constraint that has a subquery in it. I am aware that apparently PostgreSQL does NOT support subqueries in CHECK clauses, as I got the error when trying to run the query. But I am trying to figure out if there is...
29 Aug 2013 by Boipelo
Edited: Updated - New Solution I misunderstood your question earlier but the *note still stands – solution has been updated.*Note; I am not familiar with postgresql**Note: I did some research after the guilt of not understanding your question and answering what was not asked.There is...
20 Apr 2019 by BrainlessLabs.com, sibani.p
Creating a simple ORM for C++ on-top of SQL database
20 Oct 2016 by Bryan Kowalchuk
The two most common database lookup table patterns are examined
9 May 2020 by Carlos Luis Rojas Aragonés
Snippet to get started with foreign tables
30 Dec 2023 by Carlos Ramos Dec2023
I am doing a backend server and I am having some trouble while testing /register route. I think that I have configured everything correctly but it gives me the 406 error when I try to do a POST method on Postman this is the link that I am using...
31 Jul 2016 by cas tools
Hi friends,I have saved an image in my postgres database.when i want to retrieve the image back in the picture box i am getting this error ArgumentException was unhandled Parameter not valid. i have pasted my codings.What I have tried:I have tried all sorts of solutions from...
10 Nov 2012 by Casey Sheridan
Hi,I've been developing a web forms application on Windows with Visual Studio. To host it, I have a Ubuntu 12.04 machine. It will use PostgreSQL for a database. I'm currently using .Net 4.0 but I'm not sure if I need .Net 2.0I have read oodles of tutorials on how to install mod-mono,...
26 May 2011 by CDP1802
I use Postgre SQL for quite a while now, but I have not heard of any such library.I assume you know Npgsql[^] as .Net data provider for the database, but there is nothing like editors for typed datasets or the like.
8 Jan 2014 by chethan.k7845
I want connect nginx to postgresql but am not able to retrieve data from postgresql,i done nginx.config files settings and all but i didn't get help me...
21 Feb 2014 by CHill60
Well if you really want to add spaces to make up the length then you could do this ...// method 1 - pad right with spaces firstper = per.PadRight(16);// using TrimEnd in the next line effectively implements your requirement "if it's more than 16 then nothing"len1 = per.Substring(0,...
5 Mar 2015 by CHill60
The underlying data is (probably) NULL not blank, and in any event you are checking for it being equal to a space which a double value can never contain. You are also trying to assign a string value to a double.Try update tbl_transaction_master set parcel=0.00 where COALESCE(parcel, 0) =...
2 Apr 2016 by CHill60
An alternative to using SERIAL or SMALLSERIAL columns in the table would be to create a sequence. For example both these tables below end up with identical data create table t1( id SERIAL, someData varchar);CREATE SEQUENCE t3_id_seq;CREATE TABLE t3 ( id smallint NOT NULL...
22 Jun 2016 by CHill60
Read the documentation!PostgreSQL: Documentation: 9.1: Declarations[^]
25 Jun 2019 by CHill60
That looks like a User Defined Type - see CREATE TYPE (Transact-SQL) - SQL Server | Microsoft Docs[^] for the documentation and Manipulating UDT Data - SQL Server | Microsoft Docs[^] for some examples. They are available in PostgreSQL too PostgreSQL: Documentation: 9.5: User-defined Types[^]
7 Aug 2020 by CHill60
Your Create Function code is incorrect - see PostgreSQL: Documentation: 9.4: CREATE FUNCTION[^]. You have not defined the column list. For an example see PL/pgSQL Function Returns A Table[^]